allow fall back to default completion

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>
This commit is contained in:
Thomas Lamprecht 2015-12-16 10:38:19 +01:00 committed by Dietmar Maurer
parent 8eed5f915d
commit e4a1d8e240

View 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__
}