public inbox for pdm-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [PATCH datacenter-manager] cli: fix zsh shell completion definitions
@ 2026-02-24  9:02 Lukas Wagner
  2026-02-24 11:17 ` Shan Shaji
  0 siblings, 1 reply; 2+ messages in thread
From: Lukas Wagner @ 2026-02-24  9:02 UTC (permalink / raw)
  To: pdm-devel

To continue the `compadd` call on the next line, we need a literal \
and then a newline (\n), meaning we need to first escape the \ and then
add the newline character.

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
---
 cli/completions/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cli/completions/Makefile b/cli/completions/Makefile
index 5eceaea7..5d2a814f 100644
--- a/cli/completions/Makefile
+++ b/cli/completions/Makefile
@@ -20,7 +20,7 @@ _%:
 	@printf '    cmd=$${words[1]}\n' >>$@.tmp
 	@printf '    curr=$${words[cwords]}\n' >>$@.tmp
 	@printf '    prev=$${words[cwords-1]}\n' >>$@.tmp
-	@printf '    compadd -- $$(COMP_CWORD="$$cwords" COMP_LINE="$$line" COMP_POINT="$$point" \\n' >>$@.tmp
+	@printf '    compadd -- $$(COMP_CWORD="$$cwords" COMP_LINE="$$line" COMP_POINT="$$point" \\\n' >>$@.tmp
 	@printf '        $* bashcomplete "$$cmd" "$$curr" "$$prev")\n' >>$@.tmp
 	@printf '}\n' >>$@.tmp
 	mv $@.tmp $@
-- 
2.47.3





^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH datacenter-manager] cli: fix zsh shell completion definitions
  2026-02-24  9:02 [PATCH datacenter-manager] cli: fix zsh shell completion definitions Lukas Wagner
@ 2026-02-24 11:17 ` Shan Shaji
  0 siblings, 0 replies; 2+ messages in thread
From: Shan Shaji @ 2026-02-24 11:17 UTC (permalink / raw)
  To: Lukas Wagner, pdm-devel

Applied and tested the changes. To test it, i have created a new user on my VM
with ZSH shell. Both `admin` and `client` CLI completions are working fine now.

Without the above change, the completions doesn't work and i was getting the
following error:

```
_proxmox-datacenter-manager-admin:8: command not found: n
``` 

Tested-by: Shan Shaji <s.shaji@proxmox.com>

On Tue Feb 24, 2026 at 10:02 AM CET, Lukas Wagner wrote:
> To continue the `compadd` call on the next line, we need a literal \
> and then a newline (\n), meaning we need to first escape the \ and then
> add the newline character.
>
> Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
> ---
>  cli/completions/Makefile | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/cli/completions/Makefile b/cli/completions/Makefile
> index 5eceaea7..5d2a814f 100644
> --- a/cli/completions/Makefile
> +++ b/cli/completions/Makefile
> @@ -20,7 +20,7 @@ _%:
>  	@printf '    cmd=$${words[1]}\n' >>$@.tmp
>  	@printf '    curr=$${words[cwords]}\n' >>$@.tmp
>  	@printf '    prev=$${words[cwords-1]}\n' >>$@.tmp
> -	@printf '    compadd -- $$(COMP_CWORD="$$cwords" COMP_LINE="$$line" COMP_POINT="$$point" \\n' >>$@.tmp
> +	@printf '    compadd -- $$(COMP_CWORD="$$cwords" COMP_LINE="$$line" COMP_POINT="$$point" \\\n' >>$@.tmp
>  	@printf '        $* bashcomplete "$$cmd" "$$curr" "$$prev")\n' >>$@.tmp
>  	@printf '}\n' >>$@.tmp
>  	mv $@.tmp $@





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-02-24 11:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-02-24  9:02 [PATCH datacenter-manager] cli: fix zsh shell completion definitions Lukas Wagner
2026-02-24 11:17 ` Shan Shaji

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal