From 3c3a95d9b9854664d3df8e0463c18038251ba0e7 Mon Sep 17 00:00:00 2001 From: Arjan Keeman Date: Wed, 21 Sep 2022 12:03:38 +0200 Subject: [PATCH] fix incompatible zsh syntax used in bash --- src/cleo/commands/completions_command.py | 2 +- tests/commands/completion/fixtures/bash.txt | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/cleo/commands/completions_command.py b/src/cleo/commands/completions_command.py index 7d67fa0a..5117e4d3 100644 --- a/src/cleo/commands/completions_command.py +++ b/src/cleo/commands/completions_command.py @@ -164,7 +164,7 @@ def render_bash(self) -> str: for opt in sorted(cmd.definition.options, key=lambda o: o.name) ) cmds_opts += [ - f" ({command_name})", + f" {command_name})", f' opts="${{opts}} {options}"', " ;;", "", # newline diff --git a/tests/commands/completion/fixtures/bash.txt b/tests/commands/completion/fixtures/bash.txt index b42714e1..4165dd42 100644 --- a/tests/commands/completion/fixtures/bash.txt +++ b/tests/commands/completion/fixtures/bash.txt @@ -25,23 +25,23 @@ _my_function() case "$com" in - (command:with:colons) + command:with:colons) opts="${opts} --goodbye" ;; - (hello) + hello) opts="${opts} --dangerous-option --option-without-description" ;; - (help) + help) opts="${opts} " ;; - (list) + list) opts="${opts} " ;; - ('spaced command') + 'spaced command') opts="${opts} " ;;