Skip to content

Commit

Permalink
misc: Removed deprecated -A option from fish completion (#366)
Browse files Browse the repository at this point in the history
  • Loading branch information
JB26 committed Sep 2, 2023
1 parent e03ce6f commit 4c95675
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions news/366.misc.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Removed deprecated `-A` option from fish completion
2 changes: 1 addition & 1 deletion src/cleo/commands/completions_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ def sanitize(s: str) -> str:
cmds_opts += [
f"# {command_name}",
*[
f"complete -c {script_name} -A "
f"complete -c {script_name} "
f"-n '__fish_seen_subcommand_from {sanitize(command_name)}' "
f"-l {opt.name} -d '{sanitize(opt.description)}'"
for opt in sorted(cmd.definition.options, key=lambda o: o.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 @@ -26,15 +26,15 @@ complete -c script -f -n '__fish_my_function_no_subcommand' -a 'spaced command'
# command options

# command:with:colons
complete -c script -A -n '__fish_seen_subcommand_from command:with:colons' -l goodbye -d ''
complete -c script -n '__fish_seen_subcommand_from command:with:colons' -l goodbye -d ''

# hello
complete -c script -A -n '__fish_seen_subcommand_from hello' -l dangerous-option -d 'This $hould be `escaped`.'
complete -c script -A -n '__fish_seen_subcommand_from hello' -l option-without-description -d ''
complete -c script -n '__fish_seen_subcommand_from hello' -l dangerous-option -d 'This $hould be `escaped`.'
complete -c script -n '__fish_seen_subcommand_from hello' -l option-without-description -d ''

# help

# list

# 'spaced command'
complete -c script -A -n '__fish_seen_subcommand_from \'spaced command\'' -l goodbye -d ''
complete -c script -n '__fish_seen_subcommand_from \'spaced command\'' -l goodbye -d ''

0 comments on commit 4c95675

Please sign in to comment.