Skip to content

How do I know that --help or --version will be invoked from ParseResult? #2629

Closed Answered by baronfel
ptr727 asked this question in Q&A
Discussion options

You must be logged in to vote

There's not a one-shot way to do so, but if you investigate ParseResult.CommandResult.Children, if help or version were called one of the children will be an OptionResult, whose OptionResult.Option.Name will be --help, --version, etc.

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@ptr727
Comment options

@baronfel
Comment options

@ptr727
Comment options

@jonsequitur
Comment options

@ptr727
Comment options

Answer selected by ptr727
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants