mirror of
https://github.com/BurntSushi/ripgrep.git
synced 2025-05-19 09:40:22 -07:00
ripgrep: add --no-pre switch
This switch explicitly disables the --pre behavior. An empty string will also disable --pre behavior, but actually utterring an empty flag value is quite awkward, so we provide an explicit switch to do the same thing. Thanks to @c-blake for pointing this out.
This commit is contained in:
parent
209a125ea2
commit
6dc09c5b1b
16
src/app.rs
16
src/app.rs
@ -1460,8 +1460,7 @@ This flag can be disabled with --no-search-zip.
|
|||||||
|
|
||||||
let arg = RGArg::switch("no-search-zip")
|
let arg = RGArg::switch("no-search-zip")
|
||||||
.hidden()
|
.hidden()
|
||||||
.overrides("search-zip")
|
.overrides("search-zip");
|
||||||
.overrides("pre");
|
|
||||||
args.push(arg);
|
args.push(arg);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1470,8 +1469,8 @@ fn flag_pre(args: &mut Vec<RGArg>) {
|
|||||||
const LONG: &str = long!("\
|
const LONG: &str = long!("\
|
||||||
For each input FILE, search the standard output of COMMAND FILE rather than the
|
For each input FILE, search the standard output of COMMAND FILE rather than the
|
||||||
contents of FILE. This option expects the COMMAND program to either be an
|
contents of FILE. This option expects the COMMAND program to either be an
|
||||||
absolute path or to be available in your PATH. An empty string COMMAND
|
absolute path or to be available in your PATH. Either an empty string COMMAND
|
||||||
deactivates this feature.
|
or the `--no-pre` flag will disable this behavior.
|
||||||
|
|
||||||
WARNING: When this flag is set, ripgrep will unconditionally spawn a
|
WARNING: When this flag is set, ripgrep will unconditionally spawn a
|
||||||
process for every file that is searched. Therefore, this can incur an
|
process for every file that is searched. Therefore, this can incur an
|
||||||
@ -1513,8 +1512,13 @@ This overrides the -z/--search-zip flag.
|
|||||||
");
|
");
|
||||||
let arg = RGArg::flag("pre", "COMMAND")
|
let arg = RGArg::flag("pre", "COMMAND")
|
||||||
.help(SHORT).long_help(LONG)
|
.help(SHORT).long_help(LONG)
|
||||||
.overrides("search-zip")
|
.overrides("no-pre")
|
||||||
.overrides("no-search-zip");
|
.overrides("search-zip");
|
||||||
|
args.push(arg);
|
||||||
|
|
||||||
|
let arg = RGArg::switch("no-pre")
|
||||||
|
.hidden()
|
||||||
|
.overrides("pre");
|
||||||
args.push(arg);
|
args.push(arg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user