-
-
Notifications
You must be signed in to change notification settings - Fork 102
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
flagConfig() compares the command flags and the settings in the config files. The command defaults to using any value specified on the command line regardless of the value in the config files. The function must be called by all commands, and the code only needs to verify the flag values and not the config values. For example, in the current code it is necessary to check both the config and the flag values: showComments, _ := cmd.Flags().GetBool("comments") if showComments == false { showComments = getMainConfig().GetBool(CommandPrefix + "comments") } After a command calls this function, only the flags need to be checked showComments, _ := cmd.Flags().GetBool("comments") Add flagConfig function to compare command line flags and the values in the config files. Signed-off-by: Prarit Bhargava <[email protected]>
- Loading branch information
Showing
5 changed files
with
74 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters