mirror of
https://github.com/fish-shell/fish-shell
synced 2025-01-14 14:03:58 +00:00
Get the list of VMs in a less fragile way.
This commit is contained in:
parent
d61c188c3c
commit
0918b537ac
1 changed files with 8 additions and 1 deletions
|
@ -1,4 +1,11 @@
|
|||
|
||||
function __fish_get_vmctl_vms
|
||||
for line in (vmctl status | string match -e -v "MAXMEM");
|
||||
set a (string split " " $line)
|
||||
and printf "%s " $a[-1]
|
||||
end
|
||||
end
|
||||
|
||||
complete -c vmctl -xa 'console create load log reload reset start status stop pause unpause send receive' -n 'not __fish_seen_subcommand_from list console create load log reload reset start status stop pause unpause send receive'
|
||||
complete -c vmctl -n '__fish_seen_subcommand_from console reload reset start status stop pause unpause send receive' -xa '(vmctl status | string match -e -v "MAXMEM" | string replace -r "^(\s+\S+\s+){7}" "")'
|
||||
complete -c vmctl -n '__fish_seen_subcommand_from console reload reset start status stop pause unpause send receive' -xa (__fish_get_vmctl_vms)
|
||||
|
||||
|
|
Loading…
Reference in a new issue