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

Order of conflicting arguments #327

Closed
leahneukirchen opened this issue Jan 16, 2017 · 4 comments
Closed

Order of conflicting arguments #327

leahneukirchen opened this issue Jan 16, 2017 · 4 comments
Labels
question An issue that is lacking clarity on one or more points.

Comments

@leahneukirchen
Copy link

I generally prefer the --no-heading output, but there is no shortcut to enable it. After adding an alias for rg --no-heading, I discovered rg --no-heading --heading behaves just like rg --no-heading.
It would be nice if the "last argument wins", so defaults can be defined yet changed easily.

@BurntSushi
Copy link
Owner

I'm not sure if we can.

@kbknapp Is there any way to make this type of thing happen with existing clap?

@BurntSushi BurntSushi added the question An issue that is lacking clarity on one or more points. label Jan 16, 2017
@leahneukirchen
Copy link
Author

The clap README mentions POSIX Compatible Conflicts/Overrides

@kbknapp
Copy link
Contributor

kbknapp commented Jan 16, 2017

In either heading or no-heading use Arg::overrides_with(other) it's meant for exactly that purpose (allowing alias overrides).

I'm on mobile but when I get to a computer I can link to the docs page.

Edit: docs page

@BurntSushi
Copy link
Owner

Oh excellent! That sounds familiar. I'll try it out soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question An issue that is lacking clarity on one or more points.
Projects
None yet
Development

No branches or pull requests

3 participants