aboutsummaryrefslogtreecommitdiff
path: root/zsh/functions/_boom
diff options
context:
space:
mode:
authorCamil Staps2016-02-09 14:16:10 +0100
committerCamil Staps2016-11-30 19:11:06 +0100
commit350a07b0a8525645671a029621cc873b2a8d1957 (patch)
treef332a624e3182aea22e6a42c27346b3eba4203c5 /zsh/functions/_boom
parentzsh (diff)
Fixed oh-my-zsh
Diffstat (limited to 'zsh/functions/_boom')
-rw-r--r--zsh/functions/_boom29
1 files changed, 29 insertions, 0 deletions
diff --git a/zsh/functions/_boom b/zsh/functions/_boom
new file mode 100644
index 0000000..74e5d4e
--- /dev/null
+++ b/zsh/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