]> src.twobees.de Git - dotfiles.git/blob - stow/oh-my-zsh/.oh-my-zsh/plugins/lxd/lxd.plugin.zsh
a6a07425281183bf21037ed9a3a42ca283badbdb
[dotfiles.git] / stow / oh-my-zsh / .oh-my-zsh / plugins / lxd / lxd.plugin.zsh
1 _lxc_get_command_list () {
2     $_comp_command1 | sed "1,/Available Commands/d" | awk '/^[ \t]*[a-z]+/ { print $1 }'
3 }
4
5 _lxc_get_subcommand_list () {
6     $_comp_command1 ${words[2]} | sed "1,/Available Commands/d" | awk '/^[ \t]*[a-z]+/ { print $1 }'
7 }
8
9 _lxc () {
10   local curcontext="$curcontext" state line
11   typeset -A opt_args
12   _arguments \
13     '1: :->command'\
14     '*: :->args'
15
16   case $state in
17     command)
18       compadd $(_lxc_get_command_list)
19       ;;
20     *)
21         compadd $(_lxc_get_subcommand_list)
22       ;;
23   esac
24 }
25
26 compdef _lxc lxc