mirror of
https://github.com/gryf/vboxmanage-bash-completion.git
synced 2025-12-17 11:30:23 +01:00
Merge pull request #6 from schplurtz/snaplist
handle snapshot completion entirely with awk
This commit is contained in:
13
VBoxManage
13
VBoxManage
@@ -271,11 +271,14 @@ _VBoxManage() {
|
||||
snap=$(VBoxManage snapshot "${name//\\/}" \
|
||||
list | \
|
||||
grep UUID |
|
||||
awk -F ': ' '{print $2}' | \
|
||||
sed 's/ (.*//' | \
|
||||
tr '\n' '|' | \
|
||||
sed 's/|$//' | \
|
||||
sed 's/\s/\\ /g')
|
||||
awk -F ': *' -v ORS='|' '/UUID: / {
|
||||
n=$2; u=$3
|
||||
sub(/..UUID/, "", n)
|
||||
gsub(/ /, "\\ ", n);
|
||||
sub(/[)].*/, "", u)
|
||||
print n; print u
|
||||
}'
|
||||
)
|
||||
IFS='|' read -ra snap <<< "$snap"
|
||||
|
||||
for item in "${snap[@]}"
|
||||
|
||||
Reference in New Issue
Block a user