1
0
mirror of https://github.com/BurntSushi/ripgrep.git synced 2024-12-02 02:56:32 +02:00
ripgrep/crates
Jan Verbeek e0a85678e1 complete/fish: improve shell completions for fish
- Stop using `-n __fish_use_subcommand`. This had the effect of
ignoring options if a positional argument has already been given, but
that's not how ripgrep works.

- Only suggest negation options if the option they're negating is
passed (e.g., only complete `--no-pcre2` if `--pcre2` is present). The
zsh completions already do this.

- Take into account whether an option takes an argument. If an option
is not a switch then it won't suggest further options until the
argument is given, e.g. `-C<tab>` won't suggest options but `-i<tab>`
will.

- Suggest correct arguments for options. We already completed a fixed
set of choices where available, but now we go further:

  - Filenames are only suggested for options that take filenames.

  - `--pre` and `--hostname-bin` suggest binaries from `$PATH`.

  - `-t`/`--type`/&c use `--type-list` for suggestions, like in zsh,
  with a preview of the glob patterns.

  - `--encoding` uses a hardcoded list extracted from the zsh
  completions. This has been refactored into a separate file, and the
  range globs (`{1..5}`) replaced by comma globs (`{1,2,3,4,5}`) since
  those work in both shells. I verified that this produces the same
  list as before in zsh, and the same list in fish (albeit in a
  different order).

PR #2684
2024-01-06 10:39:35 -05:00
..
cli grep-cli-0.1.10 2023-11-26 14:13:03 -05:00
core complete/fish: improve shell completions for fish 2024-01-06 10:39:35 -05:00
globset globset-0.4.14 2023-11-26 14:11:05 -05:00
grep grep-0.3.1 2023-11-27 21:36:54 -05:00
ignore ignore/types: add Lean 2023-12-07 11:46:00 -05:00
matcher grep-matcher-0.1.7 2023-11-26 14:13:54 -05:00
pcre2 grep-pcre2-0.1.7 2023-11-26 14:16:46 -05:00
printer grep-printer-0.2.1 2023-11-27 21:36:02 -05:00
regex grep-regex-0.1.12 2023-11-26 14:15:44 -05:00
searcher grep-searcher-0.1.13 2023-11-27 21:34:58 -05:00