From af532cd6311c14f416fc86404d4623c9c3af385e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Avil=C3=A9s?= Date: Sun, 28 Oct 2018 14:51:59 +0100 Subject: [PATCH] Fix zsh completion to directly import in fpath --- completion/boom.zsh | 30 +----------------------------- completion/zsh/_boom | 29 +++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 29 deletions(-) mode change 100644 => 120000 completion/boom.zsh create mode 100644 completion/zsh/_boom diff --git a/completion/boom.zsh b/completion/boom.zsh deleted file mode 100644 index 74e5d4e..0000000 --- a/completion/boom.zsh +++ /dev/null @@ -1,29 +0,0 @@ -#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 diff --git a/completion/boom.zsh b/completion/boom.zsh new file mode 120000 index 0000000..e425ac9 --- /dev/null +++ b/completion/boom.zsh @@ -0,0 +1 @@ +zsh/_boom \ No newline at end of file diff --git a/completion/zsh/_boom b/completion/zsh/_boom new file mode 100644 index 0000000..74e5d4e --- /dev/null +++ b/completion/zsh/_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