zsh-goto/_label

24 lines
624 B
Text
Executable file

#compdef _label label
_label() {
local line state
_arguments -C \
"1: :->cmds" \
"*::arg:->args"
case "$state" in
cmds)
_values "label command" \
"add[Create or overwrite a label.]" \
"ls[List existing labels.]" \
"get[Fetch the location of a label.]" \
"rm[Delete a label.]"
;;
args)
case "$line[1]" in
rm|get)
_goto # get the labels as completions
;;
esac
;;
esac
}