diff --git a/shtab/__init__.py b/shtab/__init__.py index 600b5b5..5467cfd 100644 --- a/shtab/__init__.py +++ b/shtab/__init__.py @@ -599,7 +599,6 @@ def command_list(prefix, options): preamble = """\ # Custom Preamble - {} # End Custom Preamble @@ -615,12 +614,11 @@ def command_list(prefix, options): # AUTOMATCALLY GENERATED by `shtab` -${command_cases} - ${command_commands} ${command_options} +${command_cases} ${preamble} typeset -A opt_args diff --git a/tests/test_shtab.py b/tests/test_shtab.py index 87f94e2..fc8d09c 100644 --- a/tests/test_shtab.py +++ b/tests/test_shtab.py @@ -91,8 +91,8 @@ def test_prog_scripts(shell, caplog, capsys): assert script_py == ["complete -o filenames -F _shtab_shtab script.py"] elif shell == "zsh": assert script_py == [ - "#compdef script.py", "'*::: :->script.py'", "script.py)", - "_describe 'script.py commands' _commands"] + "#compdef script.py", "_describe 'script.py commands' _commands", + "'*::: :->script.py'", "script.py)"] elif shell == "tcsh": assert script_py == ["complete script.py \\"] else: