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

Add ripgrep aliases for no-ignore and hidden #98

Merged
merged 2 commits into from
Oct 11, 2017

Conversation

unsignedint
Copy link
Contributor

@unsignedint unsignedint commented Oct 11, 2017

Add -u and -uu aliases for no-ignore and no-ignore+hidden to match behaviour of ripgrep. This fixes #92.

Note: I have implemented this using a hidden argument. I am new to rust so please let me know if there is a more idiomatic approach.

@sharkdp
Copy link
Owner

sharkdp commented Oct 11, 2017

This looks fantastic!

Thank you very much for your contribution and welcome to Rust! 👍

I added just a short comment regarding three or more (possible) occurences of -u (in ripgrep)

src/main.rs Outdated
@@ -86,8 +86,8 @@ fn main() {
let config = FdOptions {
case_sensitive: case_sensitive,
search_full_path: matches.is_present("full-path"),
ignore_hidden: !matches.is_present("hidden"),
read_ignore: !matches.is_present("no-ignore"),
ignore_hidden: !(matches.is_present("hidden") || matches.occurrences_of("rg-alias-hidden-ignore") == 2),
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could potentially set this to .. >= 2, right?

ripgrep has up to three occurences of -u, so someone might try to be on the safe side by putting -uuu. Just a thought.. I think it wouldn't hurt.

@unsignedint
Copy link
Contributor Author

Thanks, done.

@sharkdp sharkdp merged commit 35e5ecd into sharkdp:master Oct 11, 2017
@sharkdp
Copy link
Owner

sharkdp commented Oct 11, 2017

Great, thanks!

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.

Options -u (and -uu) as in ripgrep
2 participants