diff options
Diffstat (limited to 'crates/core/flags/defs.rs')
-rw-r--r-- | crates/core/flags/defs.rs | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/crates/core/flags/defs.rs b/crates/core/flags/defs.rs index a0ace969..0abf0c92 100644 --- a/crates/core/flags/defs.rs +++ b/crates/core/flags/defs.rs @@ -34,6 +34,8 @@ use crate::flags::{ #[cfg(test)] use crate::flags::parse::parse_low_raw; +use super::CompletionType; + /// A list of all flags in ripgrep via implementations of `Flag`. /// /// The order of these flags matter. It determines the order of the flags in @@ -1582,6 +1584,9 @@ The encoding detection that ripgrep uses can be reverted to its automatic mode via the \flag-negate{encoding} flag. " } + fn completion_type(&self) -> CompletionType { + CompletionType::Encoding + } fn update(&self, v: FlagValue, args: &mut LowArgs) -> anyhow::Result<()> { let value = match v { @@ -1977,6 +1982,9 @@ When \flag{file} or \flag{regexp} is used, then ripgrep treats all positional arguments as files or directories to search. " } + fn completion_type(&self) -> CompletionType { + CompletionType::Filename + } fn update(&self, v: FlagValue, args: &mut LowArgs) -> anyhow::Result<()> { let path = PathBuf::from(v.unwrap_value()); @@ -2808,6 +2816,9 @@ to calling \fBgethostname\fP. On Windows, this corresponds to calling ripgrep uses your system's hostname for producing hyperlinks. "# } + fn completion_type(&self) -> CompletionType { + CompletionType::Executable + } fn update(&self, v: FlagValue, args: &mut LowArgs) -> anyhow::Result<()> { let path = PathBuf::from(v.unwrap_value()); @@ -3141,6 +3152,9 @@ If you are looking for a way to include or exclude files and directories directly on the command line, then use \flag{glob} instead. " } + fn completion_type(&self) -> CompletionType { + CompletionType::Filename + } fn update(&self, v: FlagValue, args: &mut LowArgs) -> anyhow::Result<()> { let path = PathBuf::from(v.unwrap_value()); @@ -5410,6 +5424,9 @@ format, then \fBpzstd\fP is used to decompress the contents to stdout. This overrides the \flag{search-zip} flag. "# } + fn completion_type(&self) -> CompletionType { + CompletionType::Executable + } fn update(&self, v: FlagValue, args: &mut LowArgs) -> anyhow::Result<()> { let path = match v { @@ -6781,6 +6798,9 @@ any rules found in ignore files. To see the list of available file types, use the \flag{type-list} flag. "# } + fn completion_type(&self) -> CompletionType { + CompletionType::Filetype + } fn update(&self, v: FlagValue, args: &mut LowArgs) -> anyhow::Result<()> { args.type_changes.push(TypeChange::Select { @@ -7000,6 +7020,9 @@ will only search files that are unrecognized by its type definitions. To see the list of available file types, use the \flag{type-list} flag. "# } + fn completion_type(&self) -> CompletionType { + CompletionType::Filetype + } fn update(&self, v: FlagValue, args: &mut LowArgs) -> anyhow::Result<()> { args.type_changes.push(TypeChange::Negate { |