diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2019-02-12 15:09:52 +0100 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2019-02-12 15:27:39 +0100 |
commit | 65435701efdafc6b91db542327c57c69386f02eb (patch) | |
tree | 508819bb668967e3f2f5cab197b572e292a69e9a /src/util | |
parent | 1bc149d05b09d716723d2f091250fab38fd70fc2 (diff) | |
parent | a99999cc04c2e7d79bb841fd954c84e985ed3b88 (diff) |
Merge #15358: util: Add SetupHelpOptions()
a99999cc04c2e7d79bb841fd954c84e985ed3b88 util: Add SetupHelpOptions() (MarcoFalke)
Pull request description:
Every binary we have sets up the help option in their own way and wording.
Solve that by having one function take care of it for all of them.
Tree-SHA512: 6e947fa8bc2a46fa6ca9f45777020aa269a5df0dd916ebc863224f9a1e0f79e8e7754a1478567307edd9461e8babd77d26bc2710bbd56e8f8da9020aa85a8c9c
Diffstat (limited to 'src/util')
-rw-r--r-- | src/util/system.cpp | 6 | ||||
-rw-r--r-- | src/util/system.h | 3 |
2 files changed, 9 insertions, 0 deletions
diff --git a/src/util/system.cpp b/src/util/system.cpp index bb9fcab59e..27ed24d012 100644 --- a/src/util/system.cpp +++ b/src/util/system.cpp @@ -635,6 +635,12 @@ bool HelpRequested(const ArgsManager& args) return args.IsArgSet("-?") || args.IsArgSet("-h") || args.IsArgSet("-help") || args.IsArgSet("-help-debug"); } +void SetupHelpOptions(ArgsManager& args) +{ + args.AddArg("-?", "Print this help message and exit", false, OptionsCategory::OPTIONS); + args.AddHiddenArgs({"-h", "-help"}); +} + static const int screenWidth = 79; static const int optIndent = 2; static const int msgIndent = 7; diff --git a/src/util/system.h b/src/util/system.h index 17723d427d..54d4cf2e58 100644 --- a/src/util/system.h +++ b/src/util/system.h @@ -295,6 +295,9 @@ extern ArgsManager gArgs; */ bool HelpRequested(const ArgsManager& args); +/** Add help options to the args manager */ +void SetupHelpOptions(ArgsManager& args); + /** * Format a string to be used as group of options in help messages * |