]> src.twobees.de Git - dotfiles.git/blob - stow/oh-my-zsh/.oh-my-zsh/plugins/ag/_ag
...
[dotfiles.git] / stow / oh-my-zsh / .oh-my-zsh / plugins / ag / _ag
1 #compdef ag
2 #autoload
3
4 typeset -A opt_args
5
6 # Took the liberty of not listing every option… specially aliases and -D
7 _ag () {
8   local -a _1st_arguments
9   _1st_arguments=(
10     '--ackmate:Print results in AckMate-parseable format'
11     {'-A','--after'}':[LINES] Print lines after match (Default: 2)'
12     {'-B','--before'}':[LINES] Print lines before match (Default: 2)'
13     '--break:Print newlines between matches in different files'
14     '--nobreak:Do not print newlines between matches in different files'
15     {'-c','--count'}':Only print the number of matches in each file'
16     '--color:Print color codes in results (Default: On)'
17     '--nocolor:Do not print color codes in results'
18     '--color-line-number:Color codes for line numbers (Default: 1;33)'
19     '--color-match:Color codes for result match numbers (Default: 30;43)'
20     '--color-path:Color codes for path names (Default: 1;32)'
21     '--column:Print column numbers in results'
22     {'-H','--heading'}':Print file names (On unless searching a single file)'
23     '--noheading:Do not print file names (On unless searching a single file)'
24     '--line-numbers:Print line numbers even for streams'
25     {'-C','--context'}':[LINES] Print lines before and after matches (Default: 2)'
26     '-g:[PATTERN] Print filenames matching PATTERN'
27     {'-l','--files-with-matches'}':Only print filenames that contain matches'
28     {'-L','--files-without-matches'}':Only print filenames that do not contain matches'
29     '--no-numbers:Do not print line numbers'
30     {'-o','--only-matching'}':Prints only the matching part of the lines'
31     '--print-long-lines:Print matches on very long lines (Default: 2k characters)'
32     '--passthrough:When searching a stream, print all lines even if they do not match'
33     '--silent:Suppress all log messages, including errors'
34     '--stats:Print stats (files scanned, time taken, etc.)'
35     '--vimgrep:Print results like vim :vimgrep /pattern/g would'
36     {'-0','--null'}':Separate filenames with null (for "xargs -0")'
37
38     {'-a','--all-types'}':Search all files (does not include hidden files / .gitignore)'
39     '--depth:[NUM] Search up to NUM directories deep (Default: 25)'
40     {'-f','--follow'}':Follow symlinks'
41     {'-G','--file-search-regex'}':[PATTERN] Limit search to filenames matching PATTERN'
42     '--hidden:Search hidden files (obeys .*ignore files)'
43     {'-i','--ignore-case'}':Match case insensitively'
44     '--ignore:[PATTERN] Ignore files/directories matching PATTERN'
45     {'-m','--max-count'}':[NUM] Skip the rest of a file after NUM matches (Default: 10k)'
46     {'-p','--path-to-agignore'}':[PATH] Use .agignore file at PATH'
47     {'-Q','--literal'}':Do not parse PATTERN as a regular expression'
48     {'-s','--case-sensitive'}':Match case'
49     {'-S','--smart-case'}':Insensitive match unless PATTERN has uppercase (Default: On)'
50     '--search-binary:Search binary files for matches'
51     {'-t','--all-text'}':Search all text files (Hidden files not included)'
52     {'-u','--unrestricted'}':Search all files (ignore .agignore and _all_)'
53     {'-U','--skip-vcs-ignores'}':Ignore VCS files (stil obey .agignore)'
54     {'-v','--invert-match'}':Invert match'
55     {'-w','--word-regexp'}':Only match whole words'
56     {'-z','--search-zip'}':Search contents of compressed (e.g., gzip) files'
57
58     '--list-file-types:list of supported file types'
59   )
60
61   if [[ $words[-1] =~ "^-" ]]; then
62     _describe -t commands "ag options" _1st_arguments && ret=0
63   else
64     _files && ret=0
65   fi
66 }