35 lines
603 B
Plaintext
35 lines
603 B
Plaintext
#compdef vkpurge
|
|
|
|
local context state state_descr line
|
|
typeset -A opt_args
|
|
local curcontext="$curcontext"
|
|
|
|
_arguments -C \
|
|
'1: :->subcmd' \
|
|
'*:: :->kernels'
|
|
|
|
case "$state" in
|
|
subcmd)
|
|
local subcommands=(
|
|
'list:list removable kernel versions'
|
|
'rm:remove removable kernel versions'
|
|
)
|
|
_describe -t commands subcommand subcommands
|
|
;;
|
|
kernels)
|
|
curcontext="${curcontext%:*:*}:vkpurge-$line[1]:"
|
|
case "$line[1]" in
|
|
list)
|
|
_arguments '1::version glob: '
|
|
;;
|
|
rm)
|
|
local kernels=(
|
|
'all:all removable kernels'
|
|
$(vkpurge list all)
|
|
)
|
|
_describe -t kernels kernel kernels
|
|
;;
|
|
esac
|
|
;;
|
|
esac
|