Skip to content

Commit 9de83fa

Browse files
committed
Fish completion presents only the canonical name of suggested command.
1 parent 8f20a35 commit 9de83fa

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

fish.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ func (cmd *Command) prepareFishCommands(commands []*Command, previousCommands []
6161
"complete -x -c %s -n '%s' -a '%s'",
6262
cmd.Name,
6363
cmd.fishSubcommandHelper(previousCommands, commands),
64-
strings.Join(command.Names(), " "),
64+
command.Name,
6565
)
6666

6767
if command.Usage != "" {

testdata/expected-fish-full.fish

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,17 @@ complete -c greet -n '__fish_greet_no_subcommand' -f -l flag -s fl -s f -r
1414
complete -c greet -n '__fish_greet_no_subcommand' -f -l another-flag -s b -d 'another usage text'
1515
complete -c greet -n '__fish_greet_no_subcommand' -l logfile -r
1616
complete -c greet -n '__fish_greet_no_subcommand' -l foofile -r
17-
complete -x -c greet -n '__fish_greet_no_subcommand' -a 'config c' -d 'another usage test'
17+
complete -x -c greet -n '__fish_greet_no_subcommand' -a 'config' -d 'another usage test'
1818
complete -c greet -n '__fish_seen_subcommand_from config c' -l flag -s fl -s f -r
1919
complete -c greet -n '__fish_seen_subcommand_from config c' -f -l another-flag -s b -d 'another usage text'
20-
complete -x -c greet -n '__fish_seen_subcommand_from config c; and not __fish_seen_subcommand_from sub-config s ss' -a 'sub-config s ss' -d 'another usage test'
20+
complete -x -c greet -n '__fish_seen_subcommand_from config c; and not __fish_seen_subcommand_from sub-config s ss' -a 'sub-config' -d 'another usage test'
2121
complete -c greet -n '__fish_seen_subcommand_from sub-config s ss' -f -l sub-flag -s sub-fl -s s -r
2222
complete -c greet -n '__fish_seen_subcommand_from sub-config s ss' -f -l sub-command-flag -s s -d 'some usage text'
23-
complete -x -c greet -n '__fish_greet_no_subcommand' -a 'info i in' -d 'retrieve generic information'
23+
complete -x -c greet -n '__fish_greet_no_subcommand' -a 'info' -d 'retrieve generic information'
2424
complete -x -c greet -n '__fish_greet_no_subcommand' -a 'some-command'
2525
complete -c greet -n '__fish_seen_subcommand_from hidden-command' -f -l completable
26-
complete -x -c greet -n '__fish_greet_no_subcommand' -a 'usage u' -d 'standard usage text'
26+
complete -x -c greet -n '__fish_greet_no_subcommand' -a 'usage' -d 'standard usage text'
2727
complete -c greet -n '__fish_seen_subcommand_from usage u' -l flag -s fl -s f -r
2828
complete -c greet -n '__fish_seen_subcommand_from usage u' -f -l another-flag -s b -d 'another usage text'
29-
complete -x -c greet -n '__fish_seen_subcommand_from usage u; and not __fish_seen_subcommand_from sub-usage su' -a 'sub-usage su' -d 'standard usage text'
29+
complete -x -c greet -n '__fish_seen_subcommand_from usage u; and not __fish_seen_subcommand_from sub-usage su' -a 'sub-usage' -d 'standard usage text'
3030
complete -c greet -n '__fish_seen_subcommand_from sub-usage su' -f -l sub-command-flag -s s -d 'some usage text'

0 commit comments

Comments
 (0)