Corrected file/dir completions.

This commit is contained in:
2018-09-08 17:41:02 +02:00
parent d027094e7c
commit f8b5981935

View File

@@ -649,7 +649,7 @@ _VBoxManage() {
if [[ " ${items[@]} " == *" $subcommand "* ]]; then if [[ " ${items[@]} " == *" $subcommand "* ]]; then
case "${subcommand}" in case "${subcommand}" in
nictracefile[1-8]) videocapfile|keyboardputfile|nictracefile[1-8])
[[ ${prev} == "nictracefile"* ]] && \ [[ ${prev} == "nictracefile"* ]] && \
COMPREPLY=( $(compgen -f -- ${cur}) ) COMPREPLY=( $(compgen -f -- ${cur}) )
;; ;;
@@ -730,6 +730,8 @@ _VBoxManage() {
COMPREPLY=( $(compgen -W "$result" -- ${cur}) ) COMPREPLY=( $(compgen -W "$result" -- ${cur}) )
;; ;;
esac esac
elif [[ ${prev} == "--passwordfile" || ${prev} == "--capturefile" ]]; then
COMPREPLY=( $(compgen -f -- ${cur}) )
else else
[[ ${#COMPREPLY[@]} -eq 0 ]] && \ [[ ${#COMPREPLY[@]} -eq 0 ]] && \
COMPREPLY=( $(compgen -W "${items[*]}" -- ${cur}) ) COMPREPLY=( $(compgen -W "${items[*]}" -- ${cur}) )
@@ -775,7 +777,7 @@ _VBoxManage() {
case "${prev}" in case "${prev}" in
--filename) --filename)
COMPREPLY=( $(compgen -- ${cur}) ) COMPREPLY=( $(compgen -f -- ${cur}) )
;; ;;
--diffparent) --diffparent)
COMPREPLY=() COMPREPLY=()
@@ -869,7 +871,7 @@ _VBoxManage() {
COMPREPLY+=( $(compgen -W "$result" -- ${cur}) ) COMPREPLY+=( $(compgen -W "$result" -- ${cur}) )
else else
[[ "${prev}" == "--filename" ]] && \ [[ "${prev}" == "--filename" ]] && \
COMPREPLY=( $(compgen -- ${cur}) ) COMPREPLY=( $(compgen -f -- ${cur}) )
[[ ${#COMPREPLY[@]} -eq 0 ]] && \ [[ ${#COMPREPLY[@]} -eq 0 ]] && \
COMPREPLY=( $(compgen -W "${items[*]}" -- ${cur}) ) COMPREPLY=( $(compgen -W "${items[*]}" -- ${cur}) )
fi fi
@@ -943,6 +945,8 @@ _VBoxManage() {
items=( --manifest --iso --options --vsys) items=( --manifest --iso --options --vsys)
if [[ ${prev} == ${cmd} ]]; then if [[ ${prev} == ${cmd} ]]; then
_vms_comp vms _vms_comp vms
elif [[ ${prev} == "--eulafile" ]]; then
COMPREPLY=( $(compgen -f -- ${cur}) )
else else
[[ " ${COMP_WORDS[@]} " != *" -o "* && [[ " ${COMP_WORDS[@]} " != *" -o "* &&
" ${COMP_WORDS[@]} " != *" --output "* ]] && " ${COMP_WORDS[@]} " != *" --output "* ]] &&
@@ -965,8 +969,8 @@ _VBoxManage() {
nomacsbutnat" -- ${cur}) ) nomacsbutnat" -- ${cur}) )
;; ;;
esac esac
[[ ${#COMPREPLY[@]} -eq 0 ]] && \ [[ ${#COMPREPLY[@]} -eq 0 ]] && \
COMPREPLY=( $(compgen -W "${items[*]}" -- ${cur}) ) COMPREPLY=( $(compgen -W "${items[*]}" -- ${cur}) )
fi fi
;; ;;
@@ -1302,7 +1306,7 @@ _VBoxManage() {
--image) --image)
COMPREPLY=( $(compgen -- ${cur}) ) COMPREPLY=( $(compgen -- ${cur}) )
;; ;;
--tmpdir) --target-directory|--tmpdir)
COMPREPLY=( $(compgen -o dirnames -- ${cur}) ) COMPREPLY=( $(compgen -o dirnames -- ${cur}) )
;; ;;
--source) --source)
@@ -1313,6 +1317,9 @@ _VBoxManage() {
"${COMPREPLY[0]}" != *".iso" ]] && \ "${COMPREPLY[0]}" != *".iso" ]] && \
COMPREPLY[0]="${COMPREPLY[0]}/" COMPREPLY[0]="${COMPREPLY[0]}/"
;; ;;
--passwordfile)
COMPREPLY=( $(compgen -f -- ${cur}) )
;;
esac esac
else else
[[ ${#COMPREPLY[@]} -eq 0 ]] && \ [[ ${#COMPREPLY[@]} -eq 0 ]] && \
@@ -1812,6 +1819,15 @@ _VBoxManage() {
COMPREPLY=( $(compgen -W "disabled apic x2apic" \ COMPREPLY=( $(compgen -W "disabled apic x2apic" \
-- ${cur}) ) -- ${cur}) )
;; ;;
--teleporterpasswordfile|--iconfile|--videocapfile)
COMPREPLY=( $(compgen -f -- ${cur}) )
;;
--nictracefile[1-8])
COMPREPLY=( $(compgen -f -- ${cur}) )
;;
--nattftpfile[1-8])
COMPREPLY=( $(compgen -f -- ${cur}) )
;;
esac esac
fi fi
;; ;;
@@ -2078,6 +2094,9 @@ _VBoxManage() {
--passthrough|--tempeject|--nonrotational|--discard) --passthrough|--tempeject|--nonrotational|--discard)
COMPREPLY=( $(compgen -W "on off" -- ${cur}) ) COMPREPLY=( $(compgen -W "on off" -- ${cur}) )
;; ;;
--passwordfile)
COMPREPLY=( $(compgen -f -- ${cur}) )
;;
esac esac
fi fi
;; ;;