#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 }