Skip to content

Subcommand hijacks parent's about #391

@CodeSandwich

Description

@CodeSandwich

I have a simple program:

use structopt::StructOpt;

/// The main thing
#[derive(StructOpt)]
struct Main {
    #[structopt(subcommand)]
    subcommand: Subcommand,
}

/// The subcommand
#[derive(StructOpt)]
enum Subcommand {
    A{}
}

fn main() {
    Main::from_args();
}

When I run it with cargo run -- --help, I get the following output:

poligon 0.1.0
The subcommand

USAGE:
    poligon <SUBCOMMAND>

FLAGS:
    -h, --help       Prints help information
    -V, --version    Prints version information

SUBCOMMANDS:
    a       
    help    Prints this message or the help of the given subcommand(s)

The app description should be The main thing, not The subcommand!

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugThis is a BUG. The fix may be released in a patch version even if considered breaking

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions