fork/fish-shell
git clone https://git.julia.blue/fork/fish-shell
a53db7256
master
1# localization: skip(private) 2function __fish_print_VBox_vms 3set -l print_names true 4set -l print_uuids true 5 6if contains -- nouuids$argv 7set print_uuids false 8end 9 10if contains -- nonames$argv 11set print_names false 12end 13 14# `VBoxManage list vms` output example: 15# "Machine Name" {222537b0-1ea1-454a-abf0-ed0d6c3c6346} 16# "Another Machine" {332537b4-1ea1-454a-abf0-ed1d6c3c2347} 17set -l lines( VBoxManage list vms| string match -r'"(.*)" {(.*)}' ) 18 19while set -q lines[ 3 ] 20if test $print_names = true 21printf '%s\tVirtual machine\n' $lines [ 2 ] 22end 23 24if test $print_uuids = true 25printf '%s\t%s virtual machine\n' $lines [ 3 ] $lines [ 2 ] 26end 27 28set -e lines[ 1..3] 29end 30end