-
-
Notifications
You must be signed in to change notification settings - Fork 818
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
Add opposing CLI options #822
Conversation
Those are: - `--no-hidden`, which overrides `--hidden` - `--ignore`, which overrides `--no-ignore` - `--ignore-vcs`, which overrides `--no-ignore-vcs` - `--no-follow`, which overrides `--follow` - `--relative-path`, which overrides `--absolute-path`
Looks like builds are failing |
Yes, the error is:
...which is puzzling to me since version_check = "0.9" while [[package]]
name = "version_check"
version = "0.9.3" so it should be working fine I think? I'm pretty new to Rust so honestly, I don't know how to resolve this error myself. |
Huh... I can take a closer look later today |
src/app.rs
Outdated
.arg( | ||
Arg::with_name("no-hidden") | ||
.long("no-hidden") | ||
.overrides_with("no-hidden") |
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.
Shouldn't it also override --hidden
? We don't want --hidden
and --no-hidden
to be present at the same time, right? This way, you might even be able to simplify the logic in main.rs
(not completely sure).
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.
I thought we did want to support both of them being present; at least that's the use case mentioned in the original issue here with aliasing.
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.
Ah, yes. Sorry for that. My comment was confusing. What I meant was: I think we can let clap
help us here. If we set no-hidden
"overrides_with
" hidden
, I think that clap
internally either has "hidden" or "no-hidden" present, never both.
We definitely want the user to be able to pass both of them.
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.
Ah, I see what you mean now. Yep, I think that'll clean up main.rs
a bit.
src/app.rs
Outdated
@@ -25,7 +25,17 @@ pub fn build_app() -> App<'static, 'static> { | |||
.long_help( | |||
"Include hidden directories and files in the search results (default: \ | |||
hidden files and directories are skipped). Files and directories are \ | |||
considered to be hidden if their name starts with a `.` sign (dot).", | |||
considered to be hidden if their name starts with a `.` sign (dot). \ | |||
Flag can be overridden with --no-hidden.", |
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.
Minor: for the long help text, can we please use full sentences ("The flag can be ...").
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.
Thank you very much for your contribution. Can we please update the man page as well?
Sure thing, I'll update it a bit later. |
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.
Thank you for the updates!
Closes #595
I've implemented the 5 opposing options mentioned in the issue. Those are:
--no-hidden
, which overrides--hidden
--ignore
, which overrides--no-ignore
--ignore-vcs
, which overrides--no-ignore-vcs
--no-follow
, which overrides--follow
--relative-path
, which overrides--absolute-path