zsh-goto/_label

25 lines
624 B
Text
Raw Normal View History

2022-08-11 06:11:04 +00:00
#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
}