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

fix(usage): Make dont_collapse_args_in_usage the default #4151

Merged
merged 4 commits into from Aug 30, 2022

Conversation

epage
Copy link
Member

@epage epage commented Aug 30, 2022

The setting was added to resolve #769. The reason it was optional is out
of concern for applications with a lot of positional arguments. I think
those cases are rare enough that we should just push people to override
the usage. Positional arguments are generally important enough, even if
optional, to show.

As a side effect, this fixed some bugs with
dont_collapse_args_in_usage where it would repeat an argument in a
smart usage.

As a side effect, smart usage now shows -- when it should

Along the way, misc other usage bugs were fixed

This was .text size neutral.

This is a part of #4132

`last` must always follow a `--`, so it isn't optional.
This was added in clap-rs#165 but the relative value of this doesn't seem worth
the complexity at the moment.
The setting was added to resolve clap-rs#769.  The reason it was optional is out
of concern for applications with a lot of positional arguments.  I think
those cases are rare enough that we should just push people to override
the usage.  Positional arguments are generally important enough, even if
optional, to show.

As a side effect, this fixed some bugs with
`dont_collapse_args_in_usage` where it would repeat an argument in a
smart usage.

As a side effect, smart usage now shows `--` when it should
@epage epage mentioned this pull request Aug 30, 2022
@epage epage merged commit a1256a6 into clap-rs:master Aug 30, 2022
@epage epage deleted the collapse branch August 30, 2022 21:34
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.

Don't collapse optional positional arguments into [ARGS] in the usage string
1 participant