-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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: when -aA are provided, the order matters #3285
Conversation
Ohh good find! Instead of manually checking the indices, we should probably make them override each other with clap's |
it supports the order? |
Yeah the |
bien vu, done :) |
Hey there
Nice finding @tertsdiepraam ! @sylvestre You should consider adding a comment there, as I, unfamiliar with this code , had to read this PR to understand this part of the code, and this is just using some external lib logic. This could also be reused in other tools.
(a CS prof. of mine, back in the day) |
Yeah: |
@anastygnome I think it is self explanatory but as it doesn't hurt, I added comments :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, but while we're changing this, both should also override themselves (so that ls -aa
is possible). @anastygnome this is a technique used throughout the codebase, but you're right that more comments never hurt anybody :)
I used |
Sure! That's a good solution in this case. More generally, we should probably push for using https://docs.rs/clap/3.1.6/clap/struct.App.html#method.args_override_self in (almost) all utils. |
No description provided.