mirror of
https://github.com/gryf/boxpy.git
synced 2025-12-19 13:37:58 +01:00
Added missing gnu sed definition and some cosmetic changes for completion script.
This commit is contained in:
11
box.py
11
box.py
@@ -37,7 +37,8 @@ power_state:
|
|||||||
''')
|
''')
|
||||||
COMPLETIONS = {'bash': '''\
|
COMPLETIONS = {'bash': '''\
|
||||||
_boxpy() {
|
_boxpy() {
|
||||||
local cur prev words cword
|
local cur prev words cword _GNUSED
|
||||||
|
_GNUSED=${GNUSED:-sed}
|
||||||
|
|
||||||
# Complete registered VM names.
|
# Complete registered VM names.
|
||||||
# Issues are the same as in above function.
|
# Issues are the same as in above function.
|
||||||
@@ -55,16 +56,16 @@ _boxpy() {
|
|||||||
running_vms=$(VBoxManage list runningvms | \
|
running_vms=$(VBoxManage list runningvms | \
|
||||||
awk -F ' {' '{ print $1 }' | \
|
awk -F ' {' '{ print $1 }' | \
|
||||||
tr '\n' '|' | \
|
tr '\n' '|' | \
|
||||||
$VBMC_SED 's/|$//' | \
|
$_GNUSED 's/|$//' | \
|
||||||
$VBMC_SED 's/"//g')
|
$_GNUSED 's/"//g')
|
||||||
IFS='|' read -ra running_vms <<< "$running_vms"
|
IFS='|' read -ra running_vms <<< "$running_vms"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
vms=$(VBoxManage list $command | \
|
vms=$(VBoxManage list $command | \
|
||||||
awk -F ' {' '{ print $1 }' | \
|
awk -F ' {' '{ print $1 }' | \
|
||||||
tr '\n' '|' | \
|
tr '\n' '|' | \
|
||||||
$VBMC_SED 's/|$//' | \
|
$_GNUSED 's/|$//' | \
|
||||||
$VBMC_SED 's/"//g')
|
$_GNUSED 's/"//g')
|
||||||
IFS='|' read -ra vms <<< "$vms"
|
IFS='|' read -ra vms <<< "$vms"
|
||||||
for item in "${vms[@]}"
|
for item in "${vms[@]}"
|
||||||
do
|
do
|
||||||
|
|||||||
Reference in New Issue
Block a user