From 601f212a0b64d5aa63dd9ef19c9409f5e9194181 Mon Sep 17 00:00:00 2001 From: Andrew Gallant Date: Sun, 14 Apr 2019 13:15:19 -0400 Subject: [PATCH] ripgrep: add -I as a short option for --no-filename This flag is commonly used in pipelines and it can be annoying to write it out every time you need it. Ideally, we would use -h for this to match GNU grep, but -h is used to print help output. Closes #1185 --- complete/_rg | 2 +- src/app.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/complete/_rg b/complete/_rg index 6c2ee2bb..f20a5a07 100644 --- a/complete/_rg +++ b/complete/_rg @@ -85,7 +85,7 @@ _rg() { + '(file-name)' # File-name options {-H,--with-filename}'[show file name for matches]' - "--no-filename[don't show file name for matches]" + {-I,--no-filename}"[don't show file name for matches]" + '(file-system)' # File system options "--one-file-system[don't descend into directories on other file systems]" diff --git a/src/app.rs b/src/app.rs index a3c14d95..c410b5fd 100644 --- a/src/app.rs +++ b/src/app.rs @@ -2473,7 +2473,7 @@ ripgrep is explicitly instructed to search one file or stdin. This flag overrides --with-filename. "); - let arg = RGArg::switch("no-filename") + let arg = RGArg::switch("no-filename").short("I") .help(NO_SHORT).long_help(NO_LONG) .overrides("with-filename"); args.push(arg);