Skip to content

Commit f244d43

Browse files
ritonSecrus
authored andcommitted
feat: Add option to 'command with space in name' in fixtures
* This triggers a bug in 'fish completion' script as described in https://github.com/python-poetry/poetry/issues/5929#issuecomment-1345580021 * Also adapt bash, zsh and fish sample output
1 parent 35896a0 commit f244d43

4 files changed

Lines changed: 5 additions & 2 deletions

File tree

tests/commands/completion/fixtures/bash.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ _my_function()
4242
;;
4343

4444
('spaced command')
45-
opts="${opts} "
45+
opts="${opts} --goodbye"
4646
;;
4747

4848
esac

tests/commands/completion/fixtures/command_with_space_in_name.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@
22

33
from cleo.commands.command import Command
44
from cleo.helpers import argument
5+
from cleo.helpers import option
56

67

78
class SpacedCommand(Command):
89
name = "spaced command"
910
description = "Command with space in name."
1011
arguments = [argument("test", description="test argument")]
12+
options = [option("goodbye")]

tests/commands/completion/fixtures/fish.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,4 @@ complete -c script -A -n '__fish_seen_subcommand_from hello' -l option-without-d
3737
# list
3838

3939
# 'spaced command'
40+
complete -c script -A -n '__fish_seen_subcommand_from 'spaced command'' -l goodbye -d ''

tests/commands/completion/fixtures/zsh.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ _my_function()
4848
;;
4949

5050
('spaced command')
51-
opts+=()
51+
opts+=("--goodbye")
5252
;;
5353

5454
esac

0 commit comments

Comments
 (0)