diff options
-rw-r--r-- | README.md | 12 | ||||
-rw-r--r-- | src/option-parser.cc | 2 | ||||
-rw-r--r-- | src/tools/wasm-opcodecnt.cc | 5 | ||||
-rw-r--r-- | test/README.md | 2 | ||||
-rw-r--r-- | test/help/spectest-interp.txt | 2 | ||||
-rw-r--r-- | test/help/wasm-interp.txt | 2 | ||||
-rw-r--r-- | test/help/wasm-objdump.txt | 2 | ||||
-rw-r--r-- | test/help/wasm-opcodecnt.txt | 2 | ||||
-rw-r--r-- | test/help/wasm-validate.txt | 2 | ||||
-rw-r--r-- | test/help/wasm2wat.txt | 2 | ||||
-rw-r--r-- | test/help/wast2json.txt | 2 | ||||
-rw-r--r-- | test/help/wat-desugar.txt | 2 | ||||
-rw-r--r-- | test/help/wat2wasm.txt | 2 |
13 files changed, 18 insertions, 21 deletions
@@ -149,10 +149,10 @@ $ out/wat2wasm spec-test.wast -v $ out/wast2json spec-test.wast -o spec-test.json ``` -You can use `-h` to get additional help: +You can use `--help` to get additional help: ```console -$ out/wat2wasm -h +$ out/wat2wasm --help ``` Or try the [online demo](https://cdn.rawgit.com/WebAssembly/wabt/aae5a4b7/demo/wat2wasm/). @@ -169,10 +169,10 @@ $ out/wasm2wat test.wasm -o test.wat $ out/wasm2wat test.wasm -o test.wat ``` -You can use `-h` to get additional help: +You can use `--help` to get additional help: ```console -$ out/wasm2wat -h +$ out/wasm2wat --help ``` Or try the [online demo](https://cdn.rawgit.com/WebAssembly/wabt/aae5a4b7/demo/wasm2wat/). @@ -199,10 +199,10 @@ $ out/wasm-interp test.json --spec $ out/wasm-interp test.wasm -V 100 --run-all-exports ``` -You can use `-h` to get additional help: +You can use `--help` to get additional help: ```console -$ out/wasm-interp -h +$ out/wasm-interp --help ``` ## Running wasm2c diff --git a/src/option-parser.cc b/src/option-parser.cc index 91516135..25ac4d5b 100644 --- a/src/option-parser.cc +++ b/src/option-parser.cc @@ -90,7 +90,7 @@ void OptionParser::AddOption(char short_name, } void OptionParser::AddHelpOption() { - AddOption('h', "help", "Print this help message", [this]() { + AddOption("help", "Print this help message", [this]() { PrintHelp(); exit(0); }); diff --git a/src/tools/wasm-opcodecnt.cc b/src/tools/wasm-opcodecnt.cc index fd01f62b..af418c88 100644 --- a/src/tools/wasm-opcodecnt.cc +++ b/src/tools/wasm-opcodecnt.cc @@ -59,10 +59,7 @@ static void ParseOptions(int argc, char** argv) { s_log_stream = FileStream::CreateStdout(); s_read_binary_options.log_stream = s_log_stream.get(); }); - parser.AddOption('h', "help", "Print this help message", [&parser]() { - parser.PrintHelp(); - exit(0); - }); + parser.AddHelpOption(); parser.AddOption('o', "output", "FILENAME", "Output file for the opcode counts, by default use stdout", [](const char* argument) { s_outfile = argument; }); diff --git a/test/README.md b/test/README.md index 1da9dfa3..e4fe31db 100644 --- a/test/README.md +++ b/test/README.md @@ -169,7 +169,7 @@ subdirectory: - `exceptions`: Tests the new experimental exceptions feature. - `gen-spec-js`: Tests the gen-spec-js tool, which converts a spec test into a JavaScript file. -- `help`: Tests the output of running with the `-h` flag on each tool. +- `help`: Tests the output of running with the `--help` flag on each tool. - `interp`: Tests the `wasm-interp` tool. - `opcodecnt`: Tests the `wasm-opcodecnt` tool. - `parse`: Tests parsing via the `wat2wasm` tool. diff --git a/test/help/spectest-interp.txt b/test/help/spectest-interp.txt index 99c032cc..ce4ce87e 100644 --- a/test/help/spectest-interp.txt +++ b/test/help/spectest-interp.txt @@ -11,7 +11,7 @@ examples: options: -v, --verbose Use multiple times for more info - -h, --help Print this help message + --help Print this help message --enable-exceptions Experimental exception handling --enable-mutable-globals Import/export mutable globals --enable-saturating-float-to-int Saturating float-to-int operators diff --git a/test/help/wasm-interp.txt b/test/help/wasm-interp.txt index 68f51a4c..3d3ce212 100644 --- a/test/help/wasm-interp.txt +++ b/test/help/wasm-interp.txt @@ -22,7 +22,7 @@ examples: options: -v, --verbose Use multiple times for more info - -h, --help Print this help message + --help Print this help message --enable-exceptions Experimental exception handling --enable-mutable-globals Import/export mutable globals --enable-saturating-float-to-int Saturating float-to-int operators diff --git a/test/help/wasm-objdump.txt b/test/help/wasm-objdump.txt index d81736e9..ec3e2e59 100644 --- a/test/help/wasm-objdump.txt +++ b/test/help/wasm-objdump.txt @@ -16,5 +16,5 @@ options: --debug Print extra debug information -x, --details Show section details -r, --reloc Show relocations inline with disassembly - -h, --help Print this help message + --help Print this help message ;;; STDOUT ;;) diff --git a/test/help/wasm-opcodecnt.txt b/test/help/wasm-opcodecnt.txt index dc325c38..618067b4 100644 --- a/test/help/wasm-opcodecnt.txt +++ b/test/help/wasm-opcodecnt.txt @@ -12,7 +12,7 @@ examples: options: -v, --verbose Use multiple times for more info - -h, --help Print this help message + --help Print this help message -o, --output=FILENAME Output file for the opcode counts, by default use stdout -c, --cutoff=N Cutoff for reporting counts less than N -s, --separator=SEPARATOR Separator text between element and count when reporting counts diff --git a/test/help/wasm-validate.txt b/test/help/wasm-validate.txt index 4b08c2cb..ed1923f7 100644 --- a/test/help/wasm-validate.txt +++ b/test/help/wasm-validate.txt @@ -11,7 +11,7 @@ examples: options: -v, --verbose Use multiple times for more info - -h, --help Print this help message + --help Print this help message --enable-exceptions Experimental exception handling --enable-mutable-globals Import/export mutable globals --enable-saturating-float-to-int Saturating float-to-int operators diff --git a/test/help/wasm2wat.txt b/test/help/wasm2wat.txt index 682f8a74..68de35cb 100644 --- a/test/help/wasm2wat.txt +++ b/test/help/wasm2wat.txt @@ -15,7 +15,7 @@ examples: options: -v, --verbose Use multiple times for more info - -h, --help Print this help message + --help Print this help message -o, --output=FILENAME Output file for the generated wast file, by default use stdout -f, --fold-exprs Write folded expressions where possible --enable-exceptions Experimental exception handling diff --git a/test/help/wast2json.txt b/test/help/wast2json.txt index 12992963..5a1395ee 100644 --- a/test/help/wast2json.txt +++ b/test/help/wast2json.txt @@ -13,7 +13,7 @@ examples: options: -v, --verbose Use multiple times for more info - -h, --help Print this help message + --help Print this help message --debug-parser Turn on debugging the parser of wast files --enable-exceptions Experimental exception handling --enable-mutable-globals Import/export mutable globals diff --git a/test/help/wat-desugar.txt b/test/help/wat-desugar.txt index 6028de9d..ea46287a 100644 --- a/test/help/wat-desugar.txt +++ b/test/help/wat-desugar.txt @@ -16,7 +16,7 @@ examples: $ wat-desugar --generate-names test.wat options: - -h, --help Print this help message + --help Print this help message -o, --output=FILE Output file for the formatted file --debug-parser Turn on debugging the parser of wat files -f, --fold-exprs Write folded expressions where possible diff --git a/test/help/wat2wasm.txt b/test/help/wat2wasm.txt index 9c0a6a03..35c66d6d 100644 --- a/test/help/wat2wasm.txt +++ b/test/help/wat2wasm.txt @@ -19,7 +19,7 @@ examples: options: -v, --verbose Use multiple times for more info - -h, --help Print this help message + --help Print this help message --debug-parser Turn on debugging the parser of wat files -d, --dump-module Print a hexdump of the module to stdout --enable-exceptions Experimental exception handling |