From 8f45c65830fc32e6dbbff0233dea3356acc96e57 Mon Sep 17 00:00:00 2001 From: Levente Polyak Date: Fri, 22 Dec 2023 21:04:23 +0100 Subject: 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 --- contrib/completion/zsh/_devtools.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'contrib/completion/zsh') 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}" -- cgit v1.2.3-70-g09d2