Skip to content

Help subcommand suggested even when disabled #203

@gorilskij

Description

@gorilskij

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

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions