zsh/autoenv/_autoenv
Kenneth Benzie (Benie) b85ae9b923 Add autoenv command to manage autoenv's
usage: autoenv [-h] {init,edit,deinit}

options:
        -h, --help  show this help message and exit

commands:
        init        add .enter and .exit scripts in current directory
        edit        edit .enter and .exit scripts in current directory
        deinit      remove .enter and .exit scripts in current directory

Fixes #9.
2018-04-25 21:41:30 +01:00

25 lines
630 B
Plaintext

#compdef autoenv
# Completion for the autoenv command.
_autoenv() {
local ret=1 context curcontext="$curcontext" state line
typeset -A opt_args
_arguments -C -w -s \
'(-h --help)'{-h,--help}'[show this help message and exit]' \
'1: :->command'
case $state in
(command)
declare -a commands
local commands=(
init:'add .enter and .exit scripts in current directory'
edit:'edit .enter and .exit scripts in current directory'
deinit:'remove .enter and .exit scripts in current directory'
)
_describe -t commands command commands && ret=0 ;;
esac
return ret
}