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/tools/wasm-ctor-eval.cpp | |
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/tools/wasm-ctor-eval.cpp')
-rw-r--r-- | src/tools/wasm-ctor-eval.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/tools/wasm-ctor-eval.cpp b/src/tools/wasm-ctor-eval.cpp index 701968dcd..a44ea3ceb 100644 --- a/src/tools/wasm-ctor-eval.cpp +++ b/src/tools/wasm-ctor-eval.cpp @@ -526,12 +526,15 @@ int main(int argc, const char* argv[]) { bool debugInfo = false; std::string ctorsString; + const std::string WasmCtorEvalOption = "wasm-ctor-eval options"; + ToolOptions options("wasm-ctor-eval", "Execute C++ global constructors ahead of time"); options .add("--output", "-o", "Output file (stdout if not specified)", + WasmCtorEvalOption, Options::Arguments::One, [](Options* o, const std::string& argument) { o->extra["output"] = argument; @@ -540,17 +543,20 @@ int main(int argc, const char* argv[]) { .add("--emit-text", "-S", "Emit text instead of binary for the output file", + WasmCtorEvalOption, Options::Arguments::Zero, [&](Options* o, const std::string& argument) { emitBinary = false; }) .add("--debuginfo", "-g", "Emit names section and debug info", + WasmCtorEvalOption, Options::Arguments::Zero, [&](Options* o, const std::string& arguments) { debugInfo = true; }) .add( "--ctors", "-c", "Comma-separated list of global constructor functions to evaluate", + WasmCtorEvalOption, Options::Arguments::One, [&](Options* o, const std::string& argument) { ctorsString = argument; }) .add_positional("INFILE", |