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

ls: Don't reject multiple use of --color #5643

Closed
sylvestre opened this issue Dec 12, 2023 · 2 comments · Fixed by #5641
Closed

ls: Don't reject multiple use of --color #5643

sylvestre opened this issue Dec 12, 2023 · 2 comments · Fixed by #5641
Labels

Comments

@sylvestre
Copy link
Contributor

./target/debug/coreutils ls --color=auto --color=always   
error: the argument '--color[=<color>]' cannot be used multiple times

Usage: ./target/debug/coreutils ls [OPTION]... [FILE]...

GNU accepts it

@rabbull
Copy link

rabbull commented Dec 13, 2023

Hi,

Can I propose a PR to this issue? My plan is to set parsing action of color argument to Append, which allows clap to parse multiple duplicating tags. After that, when extract the option, select only the last color tags. In addition, a test case for multiple use of --color will be added.

Best,
rabbull

@cakebaker
Copy link
Contributor

cakebaker commented Dec 13, 2023

#5641 already resolves this issue as a side effect by setting args_override_self(true)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants