Skip to content

Commit c7cfc59

Browse files
committed
Update: support bash command name alias.
1 parent 1540d47 commit c7cfc59

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

cmdcomp/v2/templates/bash.sh.jinja

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,3 +148,6 @@ cur=$COMP_CWORD
148148
}
149149

150150
complete -F {{ func_name }} -o bashdefault -o default {{ app_name }}
151+
{%- for alias in app_aliases %}
152+
complete -F {{ func_name }} -o bashdefault -o default {{ alias }}
153+
{%- endfor -%}

samples/v2/config.cmdcomp.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ version = "2"
33

44
[app]
55
name = "cliname"
6-
alias = "cliname2"
6+
alias = ["cliname2"]
77

88
[root]
99
[root.arguments.--verbose]

samples/v2/output.bash

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,3 +224,4 @@ _cliname() {
224224
}
225225

226226
complete -F _cliname -o bashdefault -o default cliname
227+
complete -F _cliname -o bashdefault -o default cliname2

0 commit comments

Comments
 (0)