Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/cleo/commands/completions_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ def sanitize(s: str) -> str:
command_name = shell_quote(cmd.name) if " " in cmd.name else cmd.name
cmds.append(
f"complete -c {script_name} -f -n '__fish{function}_no_subcommand' "
f"-a {command_name} -d '{sanitize(cmd.description)}'"
f"-a '{cmd.name}' -d '{sanitize(cmd.description)}'"
)
cmds_opts += [
f"# {command_name}",
Expand Down
8 changes: 4 additions & 4 deletions tests/commands/completion/fixtures/fish.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ complete -c script -n '__fish_my_function_no_subcommand' -l verbose -d 'Increase
complete -c script -n '__fish_my_function_no_subcommand' -l version -d 'Display this application version.'

# commands
complete -c script -f -n '__fish_my_function_no_subcommand' -a command:with:colons -d 'Test.'
complete -c script -f -n '__fish_my_function_no_subcommand' -a hello -d 'Complete me please.'
complete -c script -f -n '__fish_my_function_no_subcommand' -a help -d 'Displays help for a command.'
complete -c script -f -n '__fish_my_function_no_subcommand' -a list -d 'Lists commands.'
complete -c script -f -n '__fish_my_function_no_subcommand' -a 'command:with:colons' -d 'Test.'
complete -c script -f -n '__fish_my_function_no_subcommand' -a 'hello' -d 'Complete me please.'
complete -c script -f -n '__fish_my_function_no_subcommand' -a 'help' -d 'Displays help for a command.'
complete -c script -f -n '__fish_my_function_no_subcommand' -a 'list' -d 'Lists commands.'
complete -c script -f -n '__fish_my_function_no_subcommand' -a 'spaced command' -d 'Command with space in name.'

# command options
Expand Down