Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorLevente Polyak <anthraxx@archlinux.org>2023-12-22 21:04:23 +0100
committerLevente Polyak <anthraxx@archlinux.org>2024-01-07 19:32:30 +0100
commit8f45c65830fc32e6dbbff0233dea3356acc96e57 (patch)
tree5f84ff165f2fd9c8dba3354f5e6603430663e2cd /contrib
parentd0dc0e1a32d6ed9b166eca777f7fb7071c4c2df1 (diff)
fix(completion): support subcommands that have multiple dashes
Dashes are not supported in function names and underscores were not automatically translated. Replace all dashes of the current completion token, if it is an arg which allows subcommands to use underscores instead of dashes to declare their completion handlers. Signed-off-by: Levente Polyak <anthraxx@archlinux.org>
Diffstat (limited to 'contrib')
-rw-r--r--contrib/completion/zsh/_devtools.in2
1 files changed, 1 insertions, 1 deletions
diff --git a/contrib/completion/zsh/_devtools.in b/contrib/completion/zsh/_devtools.in
index 448fbed..b316346 100644
--- a/contrib/completion/zsh/_devtools.in
+++ b/contrib/completion/zsh/_devtools.in
@@ -295,7 +295,7 @@ _handle_subcommands() {
fi
;;
args)
- local service_sub=${service_name}_$line[1]
+ local service_sub=${service_name}_${line[1]//-/_}
if typeset -p ${service_sub}_args &> /dev/null; then
local cmd_args=${service_sub}_args[@]
_arguments -s "${(P)cmd_args}"