-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FIXED] Override of config file options with command line parameters
The idea is to call flag.Parse() twice. The first time - as it was the case before - is setting the empty Options structure with all the specified flag defaults and with values provided from the command line. If a config file is specified, we then apply to this options structure the content of the config file. This is done with a new receiver function for the Options structure. After that, we call flag.Parse() again which will override the latest changes with any command line parameter. We don't need MergeOptions() anymore since the above process takes care of the proper override. Resolves #574
- Loading branch information
Showing
3 changed files
with
142 additions
and
67 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