Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue 324 #325

Merged
merged 2 commits into from
Jan 13, 2020
Merged

Issue 324 #325

merged 2 commits into from
Jan 13, 2020

Conversation

CreepySkeleton
Copy link
Collaborator

Fixes #324

This makes version even more special. normally, I would just relocated lop_level_args() after the augment_clap call, but this would break other use cases, like clap::ArgGroup, which must be set before the .args() are set. So, only the .version() call is relocated.

This PR also relaxes restriction on #[structopt(name)] - now it can take any expr, not only strung literal. The code is much cleaner this way.

@CreepySkeleton CreepySkeleton merged commit d804cec into master Jan 13, 2020
@CreepySkeleton CreepySkeleton deleted the issue_324 branch January 13, 2020 17:29
epage added a commit to epage/clap that referenced this pull request Oct 5, 2021
TeXitoi/structopt#325 special cased `version`
because a default method would be added if the user did nothing, which
caused problems when nesting subcommands.  We no longer apply that
default method and the highest item in the chain always has precedence,
so this can be simplified / clarified.
epage added a commit to epage/clap that referenced this pull request Oct 6, 2021
TeXitoi/structopt#325 special cased `version`
because a default method would be added if the user did nothing, which
caused problems when nesting subcommands.  We no longer apply that
default method and the highest item in the chain always has precedence,
so this can be simplified / clarified.
epage added a commit to epage/clap that referenced this pull request Oct 7, 2021
TeXitoi/structopt#325 special cased `version`
because a default method would be added if the user did nothing, which
caused problems when nesting subcommands.  We no longer apply that
default method and the highest item in the chain always has precedence,
so this can be simplified / clarified.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

version = expr ignored when using subcommands
2 participants