mirror of
https://github.com/taigrr/wtf
synced 2025-01-18 04:03:14 -08:00
Clean up the flag and config handling in main()
This commit is contained in:
@@ -22,6 +22,10 @@ func NewFlags() *Flags {
|
||||
|
||||
/* -------------------- Exported Functions -------------------- */
|
||||
|
||||
func (flags *Flags) ConfigFilePath() string {
|
||||
return flags.Config
|
||||
}
|
||||
|
||||
func (flags *Flags) HasConfig() bool {
|
||||
return len(flags.Config) > 0
|
||||
}
|
||||
@@ -42,6 +46,8 @@ func (flags *Flags) Parse(version string) {
|
||||
}
|
||||
}
|
||||
|
||||
// If no config file is explicitly passed in as a param,
|
||||
// set the flag to the default config file
|
||||
if !flags.HasConfig() {
|
||||
homeDir, err := wtf.Home()
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user