Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@xaf
Copy link
Owner

@xaf xaf commented Feb 2, 2025

The void commands are auto-generated commands to be able to show the help when there exist a sub-command, but no command was defined at this level (e.g. omni a b is defined, but omni a isn't).

So far, calling omni a --help or omni a -h in that situation would simply fail (and suggest, using Did you mean?, to call omni a b). This changes that behavior by supporting the special -h and --help arguments if these are the only ones being passed to a void command, thus triggering to show the help message for that auto-generated command in that situation.

Closes #920

The `void commands` are auto-generated commands to be able to show the
help when there exist a sub-command, but no command was defined at this
level (e.g. `omni a b` is defined, but `omni a` isn't).

So far, calling `omni a --help` or `omni a -h` in that situation
would simply fail (and suggest, using `Did you mean?`, to call `omni a
b`). This changes that behavior by supporting the special `-h` and
`--help` arguments if these are the only ones being passed to a void
command, thus triggering to show the help message for that
auto-generated command in that situation.

Closes #920
@xaf xaf added the enhancement New feature or request label Feb 2, 2025
@xaf xaf marked this pull request as ready for review February 2, 2025 02:03
@github-actions github-actions bot added the rust Pull requests that update Rust code label Feb 2, 2025
@xaf xaf changed the title feat(void command): support -h and --help for auto-generated feat(void command): support -h and --help for auto-generated commands Feb 2, 2025
@xaf xaf enabled auto-merge (squash) February 2, 2025 02:04
@xaf xaf merged commit cda514a into main Feb 2, 2025
21 of 22 checks passed
@xaf xaf deleted the xaf/void_command_help branch February 2, 2025 02:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request rust Pull requests that update Rust code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

"Void" commands should support --help / -h in some specific cases

2 participants