bash completion for pct & qm

mo_

Renowned Member
Oct 27, 2011
401
9
83
Germany
Hi,

I came across something odd while trying to migrate VMs & CTs to 4.0 with backup & restore. I noticed how both "pct restore" and qmrestore dont seem to auto complete paths if you tab. Like "pct restore 12345 /var/li<TAB>" does nothing but hang the shell for a second or so. However if you do
Code:
alias pc="pct restore"
... bash completion for paths works just fine with the alias. There don't seem to be any rules for those particular binaries in /etc/bash_completion.d which made me wonder... is there another place where rules for those files might be defined? I've never actually worked with custom bash completions before so I might be missing something integral, but I'm not sure what that might be.

PS: Just upgraded, same behaviour in 4.1.
 
The completions reside in:
Code:
/usr/share/bash-completion/completions/

FYI. And yes the completion is not perfect yet, but you could try to change the configs file to match:

Code:
[...]
complete -o default -C 'pct bashcomplete' pct

Note the added -o default, save it and source the file again.

I did not see any drawbacks of adding this yet, if you also could test it and report back would be nice.