conf

conf - my dotfiles manager
git clone git://git.alex.balgavy.eu/conf.git
Log | Files | Refs | README | LICENSE

commit af6a51f9b34d09be3c9e073df3385a36c60410a0
parent 0e92396981b2919174aea157006de6e8641bc361
Author: Alex Balgavy <a.balgavy@gmail.com>
Date:   Tue, 21 Apr 2020 17:22:14 +0200

ZSH completion

Diffstat:
Aconf.zsh | 34++++++++++++++++++++++++++++++++++
1 file changed, 34 insertions(+), 0 deletions(-)

diff --git a/conf.zsh b/conf.zsh @@ -0,0 +1,34 @@ +# ZSH completion file +# Move to a folder that's in your $fpath and rename to _conf +# If you're installing with Homebrew on Mac, this is already done for you + +#compdef conf +local state line + +# Function for subcommand completion +function _cmds { + local commands + commands=( + 'link[link an entry]' + 'unlink[unlink an entry]' + 'check[check an entry]' + 'list[list entries]' + 'edit[edit the map file]' + ) + _values 'commands' $commands +} + +# The (- 1) means don't complete argument 1 or options after completing what's on the line +# The 1 is the first argument, should be completed using the _cmds function +local arguments +arguments=( + '(- 1)-man[show manual]' + '(- 1)--manual[show manual]' + '(- 1)-h[show help]' + '(- 1)--help[show help]' + '(- 1)1:: :_cmds' +) + +# -A "-*" means don't complete any options after the first normal argument +_arguments -A "-*" $arguments +