From 16c9b3042d925270d1536429a239261b5a7df9b8 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Wed, 5 Jan 2022 11:42:13 -0800 Subject: 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. --- src/support/command-line.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/support/command-line.h') 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 categories; }; } // namespace wasm -- cgit v1.2.3