google / google/argh

Help subcommand suggested even when disabled

Open
#203 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
2k
Forks
102
PR merge metrics
No merged PRs in 30d

Description

When a subcommand is added to a command such as in the following example

```rust
use argh::FromArgs;

#[derive(FromArgs)]
// note that we disable the default `help` subcommand
#[argh(help_triggers("-h", "--help"))]
///
struct Command {
#[argh(subcommand)]
subcommand: Subcommand,
}

#[derive(FromArgs)]
#[argh(subcommand, name = "subcommand")]
///
struct Subcommand {}

fn main() {
let _: Command = argh::from_env();
}
```

if the command is run without providing a subcommand, the error message is

```
One of the following subcommands must be present:
help
subcommand

Run command --help for more information.
```

even though we disabled the `help` subcommand.

Running `command help` correctly gives an error message saying unrecognized argument. The problem is only the suggestion to use the `help` subcommand even if it's not available.

Probably related to #184

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.