clap/clap_complete
Martin von Zweigbergk ea264fde16 fix(complete): Fix git diff git <TAB> for Bash
Early in the Bash-completion script, we build up a string that
identifies the command or subcommand. When we see the top-level
command's name (e.g. `git`) we set the command so far to that
value. We do that regardless of where in the argument list it
appears. For example, if the argument list is `git diff git`, we set
the current command to `git` when run into it the second time. We
therefore suggest arguments to the top-level command afterwards, which
is not correct.

This patch fixes that by also considering the string that identifies
the command so far, so we only set the overall command to `git` if the
command so far is the empty string.

This is actually just a step on the way to getting completion to work
for aliases of subcommands.

Closes #4273
2022-09-29 08:40:54 -07:00
..
examples refactor(complete): Add an alias for the subcommand 2022-09-29 08:39:49 -07:00
src fix(complete): Fix git diff git <TAB> for Bash 2022-09-29 08:40:54 -07:00
tests fix(complete): Fix git diff git <TAB> for Bash 2022-09-29 08:40:54 -07:00
Cargo.toml chore: Release 2022-09-28 15:34:33 -05:00
CHANGELOG.md chore: Release 2022-09-28 15:34:33 -05:00
CONTRIBUTING.md fix(complete): Give crates more specific names 2021-12-31 12:03:29 -06:00
LICENSE-APACHE fix(complete): Give crates more specific names 2021-12-31 12:03:29 -06:00
LICENSE-MIT docs(license): Update years/holders 2022-06-27 12:55:09 -05:00
README.md chore: Release 2022-09-28 15:34:33 -05:00

clap_complete

Shell completion generation for clap

Crates.io Crates.io License License

Dual-licensed under Apache 2.0 or MIT.

  1. About
  2. API Reference
  3. Questions & Discussions
  4. CONTRIBUTING
  5. Sponsors

About