fd icon indicating copy to clipboard operation
fd copied to clipboard

zsh completion omits the released --exact, --ignore-contain and --quiet options

Open ump45nose opened this issue 1 month ago • 1 comments

Describe the bug you encountered:

contrib/completion/_fd is the only shipped fd completion that enumerates options (fdfind.bash and fdfind.fish are delegating shims, and contrib/completion/_fdfind just calls _fd), so anything missing there is missing for every shell.

Three options that are implemented, released and documented in the man page are not in fd_args:

option parser man page in _fd
--exact src/cli.rs:190-197, added in 10.5.0 (CHANGELOG.md:17) doc/fd.1:120 no
--ignore-contain src/cli.rs:550-552, added in 10.4.0 (CHANGELOG.md:43) doc/fd.1:277 no
--quiet / -q src/cli.rs:592-601 doc/fd.1:161 no

grep -n -- '--exact\|--ignore-contain\|--quiet' contrib/completion/_fd matches only the unrelated --exact-depth entries, so e.g. fd --exact<Tab> has nothing to complete to even though the flag works.

This is not the file deliberately skipping long-help-only options: --show-errors, --max-results, -1, --path-separator and --base-directory are all hide_short_help = true in the parser and all present in the completion, so the three above look like plain oversights made when those options were added.

Describe what you expected to happen:

All three are offered by the zsh completion, with exclusions that match the parser:

  • --exact joins the existing (no-regex-pattern) group, because it is conflicts_with_all(["glob", "fixed_strings"]) (src/cli.rs:192).
  • --quiet gets its own group that excludes (max-results), and quiet is added to --max-results' exclusion list, because --quiet is conflicts_with("max_results") (src/cli.rs:597). -1 is left alone: max_one_result only overrides_with("max_results") (src/cli.rs:582) and is not in conflict with --quiet.
  • --ignore-contain is a repeatable value option (Vec<String>, value_name = "name", src/cli.rs:551-552), so it is listed with the * prefix, like --ignore-file next to it.

What version of fd are you using?

No installed binary — I read this off origin/master at 14dcd92fb76ca0ebc2e82671a275f67c790d25fc.

Which operating system / distribution are you on?

macOS. Note on verification: my sandbox has no usable zsh, no interactive completion session and no cargo build, so the only checks I actually performed are the source comparisons above, read off the origin/master ref.

ump45nose avatar Oct 16 '26 17:10 ump45nose

@ump45nose please do not use AI to automatically generate issues and PRs for fd. See https://github.com/sharkdp/fd/blob/master/CONTRIBUTING.md#pull-request-expectations.

Some of these changes are worth making, but a large number of PRs with very small changes, and verbose difficult to read AI generated descriptions is difficult on the maintainers.

tmccombs avatar Oct 18 '26 04:10 tmccombs