aboutsummaryrefslogtreecommitdiff
path: root/src/util
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2019-02-06 13:57:52 -0500
committerMarcoFalke <falke.marco@gmail.com>2019-02-06 14:16:43 -0500
commita99999cc04c2e7d79bb841fd954c84e985ed3b88 (patch)
tree4e32156106ce44a6e47805a9b7c6d8ebc7514460 /src/util
parent1a6036978e9d7fabafcd7a113a221d68bc1bd8db (diff)
util: Add SetupHelpOptions()
Diffstat (limited to 'src/util')
-rw-r--r--src/util/system.cpp6
-rw-r--r--src/util/system.h3
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
*