Skip to content

Is this the best (or only) way to figure out which subcommands have been used? #405

Description

@asdfractal

Say I have my app with nested subcommands

App sub1 sub2

In order to check that I have run app sub1 sub2 --someflag I've been using.

if parser.Command.Active.Name  // sub1 {
    if { parser.Command.Active.Active.Name  // sub2 {
        // do something
    }
}

Is that the best way?
I couldn't find anything else in the docs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions