conf

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

conf.zsh (883B)


      1 # ZSH completion file
      2 # Move to a folder that's in your $fpath and rename to _conf
      3 # If you're installing with Homebrew on Mac, this is already done for you
      4 
      5 #compdef conf
      6 local state line
      7 
      8 # Function for subcommand completion
      9 function _cmds {
     10   local commands
     11   commands=(
     12     'link[link an entry]'
     13     'unlink[unlink an entry]'
     14     'check[check an entry]'
     15     'list[list entries]'
     16     'edit[edit the map file]'
     17   )
     18   _values 'commands' $commands
     19 }
     20 
     21 # The (- 1) means don't complete argument 1 or options after completing what's on the line
     22 # The 1 is the first argument, should be completed using the _cmds function
     23 local arguments
     24 arguments=(
     25   '(- 1)-man[show manual]'
     26   '(- 1)--manual[show manual]'
     27   '(- 1)-h[show help]'
     28   '(- 1)--help[show help]'
     29   '(- 1)1:: :_cmds'
     30 )
     31 
     32 # -A "-*" means don't complete any options after the first normal argument
     33 _arguments -A "-*" $arguments
     34