Skip to content

Conversation

@catamorphism
Copy link
Contributor

Since the validate subcommand has no WebAssembly output and ignores the -o option, this removes the -o option from the help text.

Also add link to the validation algorithm and edit the help text slightly.

Since the `validate` subcommand has no WebAssembly output and ignores
the -o option, this removes the -o option from the help text.

Also add link to the validation algorithm and edit the help text
slightly.
@catamorphism catamorphism requested a review from a team as a code owner September 30, 2025 19:08
@catamorphism catamorphism requested review from dicej and removed request for a team September 30, 2025 19:08
@alexcrichton
Copy link
Member

One possible idea if you find it helpful, there could be a test at tests/cli/help-validate.wat with the contents:

;; RUN: validate -h

and then BLESS=1 would auto-generate that as tests/cli/help-validate.wat.stdout with the contents:

Validate a WebAssembly binary

Usage: wasm-tools validate [OPTIONS] [INPUT]

Arguments:
  [INPUT]  Input file to process

Options:
      --generate-dwarf <lines|full>  Optionally generate DWARF debugging information from
                                     WebAssembly text files
  -g                                 Shorthand for `--generate-dwarf full`
  -f, --features <FEATURES>          Comma-separated list of WebAssembly features to enable during
                                     validation
  -o, --output <OUTPUT>              Where to place output
  -v, --verbose...                   Use verbose output (-v info, -vv debug, -vvv trace)
      --color <COLOR>                Configuration over whether terminal colors are used in output
                                     [default: auto]
  -h, --help                         Print help (see more with '--help')

Examples:

    # Validate `foo.wasm` with the default Wasm feature proposals.
    $ wasm-tools validate foo.wasm

    # Validate `foo.wasm` with more verbose output
    $ wasm-tools validate -vv foo.wasm

    # Validate `fancy.wasm` with all Wasm feature proposals enabled.
    $ wasm-tools validate --features all fancy.wasm

    # Validate `mvp.wasm` with the original wasm feature set enabled.
    $ wasm-tools validate --features=wasm1 mvp.wasm
    $ wasm-tools validate --features=mvp mvp.wasm

and that way we could see the diff during PR review and the affect that clap updates have too

@alexcrichton alexcrichton added this pull request to the merge queue Sep 30, 2025
Merged via the queue into bytecodealliance:main with commit d81a92b Sep 30, 2025
34 checks passed
@catamorphism
Copy link
Contributor Author

Good idea about the tests -- I started on this in #2323.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants