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': '''\
|
||||
_boxpy() {
|
||||
local cur prev words cword
|
||||
local cur prev words cword _GNUSED
|
||||
_GNUSED=${GNUSED:-sed}
|
||||
|
||||
# Complete registered VM names.
|
||||
# Issues are the same as in above function.
|
||||
@@ -55,16 +56,16 @@ _boxpy() {
|
||||
running_vms=$(VBoxManage list runningvms | \
|
||||
awk -F ' {' '{ print $1 }' | \
|
||||
tr '\n' '|' | \
|
||||
$VBMC_SED 's/|$//' | \
|
||||
$VBMC_SED 's/"//g')
|
||||
$_GNUSED 's/|$//' | \
|
||||
$_GNUSED 's/"//g')
|
||||
IFS='|' read -ra running_vms <<< "$running_vms"
|
||||
fi
|
||||
|
||||
vms=$(VBoxManage list $command | \
|
||||
awk -F ' {' '{ print $1 }' | \
|
||||
tr '\n' '|' | \
|
||||
$VBMC_SED 's/|$//' | \
|
||||
$VBMC_SED 's/"//g')
|
||||
$_GNUSED 's/|$//' | \
|
||||
$_GNUSED 's/"//g')
|
||||
IFS='|' read -ra vms <<< "$vms"
|
||||
for item in "${vms[@]}"
|
||||
do
|
||||
|
||||
Reference in New Issue
Block a user