Skip to content

Instantly share code, notes, and snippets.

@Eivy
Last active May 27, 2016 04:04
Show Gist options
  • Save Eivy/3df9412afa902b0c38a436151d106b97 to your computer and use it in GitHub Desktop.
Save Eivy/3df9412afa902b0c38a436151d106b97 to your computer and use it in GitHub Desktop.
zsh completion for [jvgrep](https://github.com/mattn/jvgrep)
#compdef jvgrep
_jvgrep() {
_arguments \
'--help[show help]' \
'-F[PATTERN is a set of newline-separated fixed strings]' \
'-G[PATTERN is a basic regular expression (BRE)]' \
'-P[PATTERN is a Perl regular expression (ERE)]' \
'-S[verbose messages]' \
'-V[print version information and exit]' \
'-8[show result as utf8 text]' \
'-R[search files recursively]' \
'--enc[encodings: comma separated]:encodings:->encodings' \
'--exclude+[exclude files: specify as regexp]:regular expression:' \
'--no-color[do not print colors]' \
'--color+[print colors]:WHEN:->colors' \
'-c[count matches]' \
'-r[print relative path]' \
'-f+[obtain pattern file]:[files]:_files' \
'-i[ignore case]' \
'-I[ignore binary files]' \
'-l[print only names of FILEs containing matches]' \
'-n[print line number with output lines]' \
'-o[show only the part of a line matching PATTERN]' \
'-v[select non-matching lines]' \
'-z[a data line ends in 0 byte, not newline]' \
'-Z[print 0 byte after FILE name]' \
'--findasync[find asynchronously]' \
'-B[print NUM lines of leading context]' \
'-A[print NUM lines of trailing context]' \
'*: :_files'
case $state in
colors)
_values \
'WHEN' \
'always' \
'never' \
'auto'
;;
encodings)
_values \
'ENCODING' \
'iso-2022-jp' \
'euc-jp' \
'utf-8' \
'sjis' \
'utf-16le' \
'utf-16be'
;;
esac
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment