aboutsummaryrefslogtreecommitdiff
path: root/functions/_boom
diff options
context:
space:
mode:
authorCamil Staps2016-02-09 13:33:49 +0100
committerCamil Staps2016-11-30 19:11:06 +0100
commitae4fdb755a6e07e9f86ae34551987a446092f0db (patch)
tree2b754ae5b224c3d9fe7d073228d220555fcebac1 /functions/_boom
parenttype pass (diff)
zsh
Diffstat (limited to 'functions/_boom')
-rw-r--r--functions/_boom29
1 files changed, 29 insertions, 0 deletions
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