clap/clap_complete/tests/snapshots
Martin von Zweigbergk 9ee45f7f3d fix(complete): Fix git diff log <TAB> for Bash
This continues the work started with the fix for #4273. There was
another bug caused by using the subcommand names without considering
their position in the argument list. If the user enters `git diff log
<TAB>`, we build up a string that identifies the subcommand. We ended
up making the string `git__diff__log` in this case because we appended
`__log` without considering the current state. Since `git__diff__log`
does not correspond to an actual command, we wouldn't provide any
suggestions.

This commit restructures the code so we walk subcommands and
subsubcommands in `bash.rs`. While walking those, we build up a list
containing triples of the parent `$cmd` name (e.g. `git__diff`), the
current command's name (e.g. `log`), and the `$cmd` for the current
command. We then build the shell script's case arms based on that
information.

We could instead have fixed #4280 by using the second element in the
pair returned from `utils::all_subcommands()` (a stringified list of
the subcommand path) instead of the first one. However, that would not
have helped us solve #4265.

Closes #4280
2022-09-29 08:58:32 -07:00
..
aliases.bash fix(complete): Fix git diff git <TAB> for Bash 2022-09-29 08:40:54 -07:00
aliases.elvish fix!: Require explicit help/version disabling 2022-08-10 20:33:21 -05:00
aliases.fish fix!: Require explicit help/version disabling 2022-08-10 20:33:21 -05:00
aliases.ps1 fix!: Require explicit help/version disabling 2022-08-10 20:33:21 -05:00
aliases.zsh fix(complete): Fix handling of multiple arguments 2022-09-28 23:02:31 +03:00
basic.bash fix(complete): Fix git diff log <TAB> for Bash 2022-09-29 08:58:32 -07:00
basic.elvish fix(help): Do not propagate global args to help 2022-08-26 17:48:58 -07:00
basic.fish fix(help): Do not propagate global args to help 2022-08-26 17:48:58 -07:00
basic.ps1 fix(help): Do not propagate global args to help 2022-08-26 17:48:58 -07:00
basic.zsh fix(complete): Fix handling of multiple arguments 2022-09-28 23:02:31 +03:00
feature_sample.bash fix(complete): Fix git diff log <TAB> for Bash 2022-09-29 08:58:32 -07:00
feature_sample.elvish feat(complete): Add completion for help subcommands 2022-08-25 13:58:08 -07:00
feature_sample.fish feat(complete): Add completion for help subcommands 2022-08-25 13:58:08 -07:00
feature_sample.ps1 feat(complete): Add completion for help subcommands 2022-08-25 13:58:08 -07:00
feature_sample.zsh fix(complete): Fix handling of multiple arguments 2022-09-28 23:02:31 +03:00
quoting.bash fix(complete): Fix git diff log <TAB> for Bash 2022-09-29 08:58:32 -07:00
quoting.elvish test(complete): Disable normalization of \ to / 2022-09-02 14:46:12 +02:00
quoting.fish test(complete): Disable normalization of \ to / 2022-09-02 14:46:12 +02:00
quoting.ps1 test(complete): Disable normalization of \ to / 2022-09-02 14:46:12 +02:00
quoting.zsh fix(complete): Fix handling of multiple arguments 2022-09-28 23:02:31 +03:00
register_minimal.bash feat(complete): Minimal rust-completion 2022-04-27 15:49:58 -05:00
special_commands.bash fix(complete): Fix git diff log <TAB> for Bash 2022-09-29 08:58:32 -07:00
special_commands.elvish feat(complete): Add completion for help subcommands 2022-08-25 13:58:08 -07:00
special_commands.fish feat(complete): Add completion for help subcommands 2022-08-25 13:58:08 -07:00
special_commands.ps1 feat(complete): Add completion for help subcommands 2022-08-25 13:58:08 -07:00
special_commands.zsh fix(complete): Fix handling of multiple arguments 2022-09-28 23:02:31 +03:00
sub_subcommands.bash fix(complete): Fix git diff log <TAB> for Bash 2022-09-29 08:58:32 -07:00
sub_subcommands.elvish fix(complete): Escape , in completions for fish 2022-09-02 14:47:04 +02:00
sub_subcommands.fish fix(complete): Escape , in completions for fish 2022-09-02 14:47:04 +02:00
sub_subcommands.ps1 fix(complete): Escape , in completions for fish 2022-09-02 14:47:04 +02:00
sub_subcommands.zsh test(complete): Include a visible command alias 2022-09-29 08:40:54 -07:00
value_hint.bash fix(complete): Fix git diff git <TAB> for Bash 2022-09-29 08:40:54 -07:00
value_hint.elvish fix!: Require explicit help/version disabling 2022-08-10 20:33:21 -05:00
value_hint.fish fix!: Require explicit help/version disabling 2022-08-10 20:33:21 -05:00
value_hint.ps1 fix!: Require explicit help/version disabling 2022-08-10 20:33:21 -05:00
value_hint.zsh fix(complete): Fix handling of multiple arguments 2022-09-28 23:02:31 +03:00