diff options
author | Alon Zakai <azakai@google.com> | 2022-01-05 11:42:13 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-05 11:42:13 -0800 |
commit | 16c9b3042d925270d1536429a239261b5a7df9b8 (patch) | |
tree | 4c27cdfa36afbb6e66f69b7dab4292aa76926ea9 /src/support/command-line.h | |
parent | 79f76987ca899241a3f45d61e9b7964bcffb31a1 (diff) | |
download | binaryen-16c9b3042d925270d1536429a239261b5a7df9b8.tar.gz binaryen-16c9b3042d925270d1536429a239261b5a7df9b8.tar.bz2 binaryen-16c9b3042d925270d1536429a239261b5a7df9b8.zip |
Add categories to --help text (#4421)
The general shape of the --help output is now:
========================
wasm-foo
Does the foo operation
========================
wasm-foo opts:
--------------
--foo-bar ..
Tool opts:
----------
..
The options are now in categories, with the more specific ones - most likely to be
wanted by the user - first. I think this makes the list a lot less confusing.
In particular, in wasm-opt all the opt passes are now in their own category.
Also add a script to make it easy to update the help tests.
Diffstat (limited to 'src/support/command-line.h')
-rw-r--r-- | src/support/command-line.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/support/command-line.h b/src/support/command-line.h index 19b2546d9..354bbb586 100644 --- a/src/support/command-line.h +++ b/src/support/command-line.h @@ -56,6 +56,7 @@ public: Options& add(const std::string& longName, const std::string& shortName, const std::string& description, + const std::string& category, Arguments arguments, const Action& action, bool hidden = false); @@ -69,6 +70,7 @@ private: std::string longName; std::string shortName; std::string description; + std::string category; Arguments arguments; Action action; bool hidden; @@ -78,6 +80,9 @@ private: Arguments positional; std::string positionalName; Action positionalAction; + + // The category names, in the order in which help will be printed. + std::vector<std::string> categories; }; } // namespace wasm |