From ae4fdb755a6e07e9f86ae34551987a446092f0db Mon Sep 17 00:00:00 2001 From: Camil Staps Date: Tue, 9 Feb 2016 13:33:49 +0100 Subject: zsh --- functions/_boom | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 functions/_boom (limited to 'functions/_boom') diff --git a/functions/_boom b/functions/_boom new file mode 100644 index 0000000..74e5d4e --- /dev/null +++ b/functions/_boom @@ -0,0 +1,29 @@ +#compdef boom + +local state line cmds ret=1 + +_arguments -C '1: :->cmds' '*: :->args' + +case $state in + cmds) + local -a cmds + cmds=( + 'all:show all items in all lists' + 'edit:edit the boom JSON file in $EDITOR' + 'help:help text' + ) + _describe -t commands 'boom command' cmds && ret=0 + _values 'lists' $(boom | awk '{print $1}') + ;; + args) + case $line[1] in + (boom|all|edit|help) + ;; + *) + _values 'items' `boom $line[1] | awk '{print $1}' | sed -e 's/://'` 2>/dev/null && ret=0 + ;; + esac + ;; +esac + +return ret -- cgit v1.2.3