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

Feat 1013 #1277

Closed
wants to merge 200 commits into from
Closed

Feat 1013 #1277

wants to merge 200 commits into from

Conversation

pierrechevalier83
Copy link

@pierrechevalier83 pierrechevalier83 commented May 28, 2018

Optionally align the arguments across all categories.
This addresses the issue reported in #1013.

It is a compile time option of clap that can be enabled by adding this into one's Cargo.toml

[dependencies.clap]
features = [ "align_all" ]

This change is Reviewable

tchajed and others added 30 commits February 1, 2018 21:22
Suppose there is a program that executes another program, then it is
convenient to take the arguments of the subprogram after `--`, as
illustrated in the 22_stop_parsing_with_--.rs example. However, if
the subprogram itself wants to receive `--`, then clap-rs should
allow it.

Fixes clap-rs#1161.
…elves

This allows properly supporting shell aliases and config files.

Before, if an option only accepted a single value and that option was
set inside an alias, the CLI could never override that value.

For instance:

```
$ alias prog='prog --option=value'
$ prog --option=other
```

This would cause an error. Now clap gracefully accepts the new value to replace the old value.

Closes clap-rs#976
…show up as required

Prior to this commit if one had two requirements which conflicted with each other, and an
error was generated due to a totally seperate argument, BOTH required but conflicting args
would show up in the help message as "missing but required"

This is now fixed and the *used* required arg shows up, but the conflicting required arg
has been dropped.

Closes clap-rs#1158
…ouldnt ever have multiple values

Prior to this commit, an option with multiple values and that also overrode itself (either manually
or via AppSettings::AllArgsOverrideSelf) could never have more than one value. This is fixed as
options with multiple values now ignore the override of self.

If one wants to have options with overrides of self, *and* multiple values you should set
use_delimiter(false) and *not* set multiple(true). Then tell users to use a comma to seperate
their values, i.e. `val1,val2`.
Add "last" to list in Arg::from_yaml
style: changes values->possible values in help messages as well as er…
imp(Deps): doesnt compile ansi_term on Windows since its not used
Before this commit, ansi_term was compiled anytime the `color` feature
was used. However, on Windows the `color` feature is ignored. Even so
ansi_term was compiled, and just not used. This commit fixes that by
only compiling ansi_term on non-Windows targets. Thanks to @retep998 for
the gudiance.

Closes clap-rs#1155
@pksunkara
Copy link
Member

@pierrechevalier83 Can you please rebase on master?

@pksunkara
Copy link
Member

@ldm0 Was this done by your recent alignment fixes?

@ldm0
Copy link
Member

ldm0 commented Jan 4, 2021

@ldm0 Was this done by your recent alignment fixes?

Nope, that PR fixes the inconsistent help wrapping. This issue is about consistently align the arguments.

@ldm0 ldm0 self-assigned this Mar 9, 2021
@ldm0 ldm0 removed their assignment Oct 29, 2021
@kbknapp
Copy link
Member

kbknapp commented Nov 16, 2021

Apologies if the ball was dropped on this one. I'm going to close as it's been several years. If we need to re-address I'd suggest opening a new PR on the latest master. Although I don't something like this merging until post v3 release since we should be in a feature freeeze.

@kbknapp kbknapp closed this Nov 16, 2021
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.