Commit cfd18839 authored by Maria Matejka's avatar Maria Matejka

bash completion, bad but useful

parent 66ecde5e
_virt() {
local cur prev opts
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
case "$prev" in
start) opts=$(vctl status | sed -n "s/ not running$//p")
;;
stop) opts=$(vctl status | grep -v "not running" | sed "s/ .*//")
;;
*) opts=$(vctl | tail -n+2)
;;
esac
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
return 0
}
complete -F _virt vctl
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment