Removed trailing whitespaces
This commit is contained in:
@@ -23,16 +23,16 @@ __vboxmanage_startvm() {
|
||||
|
||||
__vboxmanage_list() {
|
||||
INPUT=$(vboxmanage list | tr -s '[\[\]\|\n]' ' ' | cut -d' ' -f4-)
|
||||
|
||||
|
||||
PRUNED=""
|
||||
if [ "$1" == "long" ]; then
|
||||
for WORD in $INPUT; do
|
||||
[ "$WORD" == "-l" ] && continue;
|
||||
[ "$WORD" == "--long" ] && continue;
|
||||
|
||||
|
||||
PRUNED="$PRUNED $WORD"
|
||||
done
|
||||
else
|
||||
else
|
||||
PRUNED=$INPUT
|
||||
fi
|
||||
|
||||
@@ -47,7 +47,7 @@ __vboxmanage_list_vms() {
|
||||
else
|
||||
SEPARATOR=$1
|
||||
fi
|
||||
|
||||
|
||||
for VM in $(vboxmanage list vms | cut -d' ' -f1 | tr -d '"'); do
|
||||
[ "$VMS" != "" ] && VMS="${VMS}${SEPARATOR}"
|
||||
VMS="${VMS}${VM}"
|
||||
@@ -63,7 +63,7 @@ __vboxmanage_list_runningvms() {
|
||||
else
|
||||
SEPARATOR=$1
|
||||
fi
|
||||
|
||||
|
||||
for VM in $(vboxmanage list runningvms | cut -d' ' -f1 | tr -d '"'); do
|
||||
[ "$VMS" != "" ] && VMS="${VMS}${SEPARATOR}"
|
||||
VMS="${VMS}${VM}"
|
||||
@@ -81,7 +81,7 @@ __vboxmanage_controlvm() {
|
||||
echo "screenshotpng setcredentials teleport plugcpu unplugcpu"
|
||||
echo "cpuexecutioncap"
|
||||
|
||||
# setlinkstate<1-N>
|
||||
# setlinkstate<1-N>
|
||||
# nic<1-N> null|nat|bridged|intnet|hostonly|generic
|
||||
# [<devicename>] |
|
||||
# nictrace<1-N> on|off
|
||||
@@ -136,9 +136,9 @@ __vboxmanage_default() {
|
||||
done
|
||||
(( $MATCH == 1 )) && continue;
|
||||
pruned="$pruned $WORD"
|
||||
|
||||
|
||||
done
|
||||
|
||||
|
||||
# COMPREPLY=($(compgen -W "${pruned}" -- ${cur}))
|
||||
echo $pruned
|
||||
return 0
|
||||
@@ -156,13 +156,13 @@ _vboxmanage() {
|
||||
|
||||
# In case current is complete command
|
||||
case $cur in
|
||||
startvm|list|controlvm)
|
||||
startvm|list|controlvm)
|
||||
COMPREPLY=($(compgen -W "$cur "))
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
|
||||
case $prev in
|
||||
case $prev in
|
||||
-v|--version)
|
||||
return 0
|
||||
;;
|
||||
@@ -170,13 +170,13 @@ _vboxmanage() {
|
||||
-l|--long)
|
||||
opts=$(__vboxmanage_list "long")
|
||||
COMPREPLY=($(compgen -W "${opts}" -- ${cur}))
|
||||
return 0
|
||||
return 0
|
||||
;;
|
||||
startvm|list)
|
||||
opts=$(__vboxmanage_$prev)
|
||||
COMPREPLY=($(compgen -W "${opts}" -- ${cur}))
|
||||
return 0
|
||||
;;
|
||||
return 0
|
||||
;;
|
||||
--type)
|
||||
COMPREPLY=($(compgen -W "gui headless" -- ${cur}))
|
||||
return 0
|
||||
@@ -204,7 +204,7 @@ _vboxmanage() {
|
||||
# echo "previous: $pprev"
|
||||
case $pprev in
|
||||
startvm)
|
||||
opts="--type"
|
||||
opts="--type"
|
||||
COMPREPLY=($(compgen -W "${opts}" -- ${cur}))
|
||||
return 0
|
||||
;;
|
||||
|
||||
Reference in New Issue
Block a user