mirror of
https://github.com/DictXiong/dotfiles.git
synced 2026-01-10 04:27:48 +08:00
36 lines
777 B
Plaintext
36 lines
777 B
Plaintext
#compdef beaml
|
|
|
|
_beaml() {
|
|
local context state line
|
|
typeset -A opt_args
|
|
|
|
_arguments -C \
|
|
'1: :->cmds' \
|
|
'2: :->args'
|
|
|
|
case $state in
|
|
cmds)
|
|
local commands; commands=(
|
|
'add:Add a new item'
|
|
'del:Delete an item'
|
|
'list:List all items'
|
|
)
|
|
_describe -t commands 'beaml commands' commands
|
|
;;
|
|
args)
|
|
case $line[1] in
|
|
add)
|
|
_files
|
|
;;
|
|
del)
|
|
local -a items
|
|
items=( /pss/lite/*(N:t) )
|
|
_describe -t items 'item to delete' items
|
|
;;
|
|
esac
|
|
;;
|
|
esac
|
|
}
|
|
|
|
_beaml "$@"
|