add ZSH completion function _grc

Based on zsh's provided _sudo function
This commit is contained in:
xPMo 2018-03-09 02:11:51 -06:00 committed by GitHub
parent ffd3b12a40
commit f4ecb7249b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 25 additions and 0 deletions

25
_grc Normal file
View File

@ -0,0 +1,25 @@
#compdef grc
setopt localoptions extended_glob
local environ e cmd
local -a args
local -a _comp_priv_prefix
zstyle -a ":completion:${curcontext}:" environ environ
for e in "${environ[@]}"
do local -x "$e"
done
args=(
'(-e --stderr)'{-e,--stderr}'[redirect stderr; do not automatically redirect stdout]'
'(-s --stdout)'{-s,--stdout}'[redirect stdout; even with -e/--stderr]'
'(-c <name>--config=<name>)'{-c+,--config=-}'[use <name> as configuration file for grcat]:file:_files'
'--color=-[colo?urize output]:color:(on off auto)'
'(-h --help)'{-h,--help}'[display help message and exit]'
'--pty[run command in pseudotermnial (experimental)]'
'*::arguments:{ _normal }'
)
_arguments -s $args