]> git.proxmox.com Git - pve-common.git/commitdiff
allow fall back to default completion
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 16 Dec 2015 09:38:19 +0000 (10:38 +0100)
committerDietmar Maurer <dietmar@proxmox.com>
Sat, 19 Dec 2015 08:04:40 +0000 (09:04 +0100)
This allows a fall back to the default completion, which completes
possible paths/files, if nothing can be generated from the PVE
completion handler ($print_bash_completion) or if the user starts
to entry a path.
This is especially useful for restore or create commands which can
take an archive file as argument.

The bash-completions get generated at each package build through the
respective Makefile, so to let this change come in effect the package
needs to be rebuild and installed (and the respective file from
/usr/share/bash-completion/completions/<pve cli tool> needs to be
sourced again (or simply open a new terminal))

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
src/PVE/CLIHandler.pm

index f973bdc1ccce6c2425665fa3e5bd2caeb5f82fd5..149353797238ef481e135fafb9e65b51259a21bf 100644 (file)
@@ -337,7 +337,7 @@ sub generate_bash_completions {
 # this modifies global var, but I found no better way
 COMP_WORDBREAKS=\${COMP_WORDBREAKS//:}
 
-complete -C '$exename bashcomplete' $exename
+complete -o default -C '$exename bashcomplete' $exename
 __EOD__
 }