Skip to content

Commit 9c5a6a1

Browse files
committed
Fix: bug.
1 parent f4e9b9e commit 9c5a6a1

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

cmdcomp/v1/templates/zsh.sh.jinja

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@
1919
esac
2020
;;
2121
{%- elif completion|first is mapping and 'command' in completion|first %}
22-
_values '{{ name }}' {{ (completion|first).command }}
22+
_values '{{ name|replace("-", "_") }}' {{ (completion|first).command }}
2323
;;
2424
{%- elif completion|first is mapping and 'file' in completion|first %}
2525
_files -W "{{ (completion|first).file }}"
2626
;;
2727
{%- else %}
28-
_values '{{ name }}' {{ completion|join(" ") }}
28+
_values '{{ name|replace("-", "_") }}' {{ completion|join(" ") }}
2929
;;
3030
{%- endif %}
3131
{%- endfor %}

samples/v1/config.cmdcomp.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,6 @@ options = { type = "file", base_path = "$(cd $(dirname $0); pwd)/../apps" }
2424
[root.subcommands.test.subcommands.rubocop]
2525
options = ["-A"]
2626

27-
[root.subcommands.and_normal_options_work]
27+
[root.subcommands.and-normal-options-work]
2828
options = ["-h", "--help"]
2929
subcommands = { foo = {}, bar = {} }

samples/v1/config.cmdcomp.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ root:
2323
subcommands:
2424
rubocop:
2525
options: ["-A"]
26-
and_normal_options_work:
26+
and-normal-options-work:
2727
options: ["-h", "--help"]
2828
subcommands:
2929
foo:

samples/v1/output.bash

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ _your_cli_command_name() {
66

77
case $cword in
88
1)
9-
COMPREPLY=( $(compgen -W "-h --help --version welcome list ls execute restart shell log cd test and_normal_options_work" -- "$cur") )
9+
COMPREPLY=( $(compgen -W "-h --help --version welcome list ls execute restart shell log cd test and-normal-options-work" -- "$cur") )
1010
;;
1111
2)
1212
case ${words[1]} in
@@ -22,7 +22,7 @@ _your_cli_command_name() {
2222
test)
2323
COMPREPLY=( $(compgen -W "rubocop" -- "$cur") )
2424
;;
25-
and_normal_options_work)
25+
and-normal-options-work)
2626
COMPREPLY=( $(compgen -W "-h --help foo bar" -- "$cur") )
2727
;;
2828
esac

samples/v1/output.zsh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ _your_cli_command_name() {
55

66
case "$(($CURRENT-1))" in
77
1)
8-
_values 'your_cli_command_name' -h --help --version welcome list ls execute restart shell log cd test and_normal_options_work
8+
_values 'your_cli_command_name' -h --help --version welcome list ls execute restart shell log cd test and-normal-options-work
99
;;
1010
2)
1111
case ${words[1]} in
@@ -21,7 +21,7 @@ _your_cli_command_name() {
2121
test)
2222
_values 'test' rubocop
2323
;;
24-
and_normal_options_work)
24+
and-normal-options-work)
2525
_values 'and_normal_options_work' -h --help foo bar
2626
;;
2727
esac

0 commit comments

Comments
 (0)