Skip to content

Commit

Permalink
fix #392
Browse files Browse the repository at this point in the history
  • Loading branch information
genivia-inc committed May 16, 2024
1 parent 8702bf6 commit 994ccba
Show file tree
Hide file tree
Showing 5 changed files with 124 additions and 111 deletions.
54 changes: 28 additions & 26 deletions completions/zsh/_ug
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
#compdef ug
#compdef ug ug+ ugrep ugrep+

# zsh completions for 'ugrep'
# Autogenerated from ugrep --help

local matchers='(--extended-regexp --fixed-strings --basic-regexp --perl-regexp --fuzzy -E -F -G -P -Z)'
local arguments=(
'(-e --regexp -f --file)1: :_guard "^-*" pattern'
'*: :_files'
{-A,--after-context=-}'[Output NUM lines of trailing context after matching lines]'
{-a,--text}'[Process a binary file as if it were text]'
{--all,-@}'[Search all files except hidden: cancel previous file and directory search restrictions and cancel --ignore-binary and --ignore-files when specified]'
--and'[Specify additional PATTERN that must match]'
--andnot'[Combines --and --not]'
'(1)*'--and'[Specify additional PATTERN that must match]'
'(1)*'--andnot'[Combines --and --not]'
{-B,--before-context=-}'[Output NUM lines of leading context before matching lines]'
{-b,--byte-offset}'[The offset in bytes of a pattern match is displayed in front of the respective matched line]'
--binary-files=-'[Controls searching and reporting pattern matches in binary files]'
Expand All @@ -28,39 +31,39 @@ local arguments=(
--delay=-'[Set the default -Q key response delay]'
{--depth=-,-1,-2,-3,-9,-10,-11}'[Restrict recursive searches from MIN to MAX directory levels deep, where -1 (--depth=1) searches the specified path without recursing into subdirectories]'
--dotall'[Dot . in regular expressions matches anything, including newline]'
{-E,--extended-regexp}'[Interpret patterns as extended regular expressions (EREs)]'
{-e,--regexp=-}'[Specify a PATTERN to search the input]:PATTERN:( )'
$matchers{-E,--extended-regexp}'[Interpret patterns as extended regular expressions (EREs)]'
'(1)*'{-e,--regexp=-}'[Specify a PATTERN to search the input]:PATTERN:( )'
--encoding=-'[The encoding format of the input]:ENCODING:(binary ASCII UTF-8 UTF-16 UTF-16BE UTF-16LE UTF-32 UTF-32BE UTF-32LE LATIN1 ISO-8859-1 ISO-8859-2 ISO-8859-3 ISO-8859-4 ISO-8859-5 ISO-8859-6 ISO-8859-7 ISO-8859-8 ISO-8859-9 ISO-8859-10 ISO-8859-11 ISO-8859-13 ISO-8859-14 ISO-8859-15 ISO-8859-16 MAC MACROMAN EBCDIC CP437 CP850 CP858 CP1250 CP1251 CP1252 CP1253 CP1254 CP1255 CP1256 CP1257 CP1258 KOI8-R KOI8-U KOI8-RU )'
--exclude=-'[Exclude files whose name matches GLOB, same as -g ^GLOB]'
--exclude-dir=-'[Exclude directories whose name matches GLOB from recursive searches, same as -g ^GLOB/]'
--exclude-from=-'[Read the globs from FILE and skip files and directories whose name matches one or more globs]'
--exclude-fs=-'[Exclude file systems specified by MOUNTS from recursive searches]'
{-F,--fixed-strings}'[Interpret pattern as a set of fixed strings, separated by newlines, any of which is to be matched]'
{-f,--file=-}'[Read newline-separated patterns from FILE]:FILE:_files'
'(1)*'--exclude=-'[Exclude files whose name matches GLOB, same as -g ^GLOB]'
'(1)*'--exclude-dir=-'[Exclude directories whose name matches GLOB from recursive searches, same as -g ^GLOB/]'
'(1)*'--exclude-from=-'[Read the globs from FILE and skip files and directories whose name matches one or more globs]'
'(1)*'--exclude-fs=-'[Exclude file systems specified by MOUNTS from recursive searches]'
$matchers{-F,--fixed-strings}'[Interpret pattern as a set of fixed strings, separated by newlines, any of which is to be matched]'
'(1)*'{-f,--file=-}'[Read newline-separated patterns from FILE]:FILE:_files'
--filter=-'[Filter files through the specified COMMANDS first before searching]'
--filter-magic-label=-'[Associate LABEL with files whose signature "magic bytes" match the MAGIC regex pattern]'
--format=-'[Output FORMAT-formatted matches]'
--free-space'[Spacing (blanks and tabs) in regular expressions are ignored]'
{-G,--basic-regexp}'[Interpret patterns as basic regular expressions (BREs)]'
{-g,--glob=-,--iglob=-}'[Only search files whose name matches the specified comma-separated list of GLOBS, same as --include=glob for each glob in GLOBS]:GLOB:( )'
$matchers{-G,--basic-regexp}'[Interpret patterns as basic regular expressions (BREs)]'
'(1)*'{-g,--glob=-,--iglob=-}'[Only search files whose name matches the specified comma-separated list of GLOBS, same as --include=glob for each glob in GLOBS]:GLOB:( )'
--glob-ignore-case'[Perform case-insensitive glob matching in general]'
--group-separator'[Use SEP as a group separator for context options -A, -B and -C]'
--no-group-separator'[Removes the group separator line from the output for context options -A, -B and -C]'
{-H,--with-filename}'[Always print the filename with output lines]'
{-h,--no-filename}'[Never print filenames with output lines]'
{--heading,-+}'[Group matches per file]'
{--help,-?}'[Display a help message on options related to WHAT when specified]'
'(-)'{--help,-?}'[Display a help message on options related to WHAT when specified]'
--hexdump=-'[Output matches in 1 to 8 columns of 8 hexadecimal octets]:NUM:(1a 2a 4ah 6ah 8ah 1aC1 2aC1 4ahC1 6ahC1 8ahC1)'
{--hidden,-.}'[Search hidden files and directories]'
--hyperlink'[Hyperlinks are enabled for file names when colors are enabled]'
{-I,--ignore-binary}'[Ignore matches in binary files]'
{-i,--ignore-case}'[Perform case insensitive matching]'
--ignore-files'[Ignore files and directories matching the globs in each FILE that is encountered in recursive searches]'
'(1)*'--ignore-files'[Ignore files and directories matching the globs in each FILE that is encountered in recursive searches]'
--no-ignore-files'[Do not ignore files, i.e. cancel --ignore-files when specified]'
--include=-'[Only search files whose name matches GLOB, same as -g GLOB]'
--include-dir=-'[Only directories whose name matches GLOB are included in recursive searches, same as -g GLOB/]'
--include-from=-'[Read the globs from FILE and search only files and directories whose name matches one or more globs]'
--include-fs=-'[Only file systems specified by MOUNTS are included in recursive searches]'
'(1)*'--include=-'[Only search files whose name matches GLOB, same as -g GLOB]'
'(1)*'--include-dir=-'[Only directories whose name matches GLOB are included in recursive searches, same as -g GLOB/]'
'(1)*'--include-from=-'[Read the globs from FILE and search only files and directories whose name matches one or more globs]'
'(1)*'--include-fs=-'[Only file systems specified by MOUNTS are included in recursive searches]'
--index'[Perform index-based recursive search]'
{-J,--jobs=-}'[Specifies the number of threads spawned to search files]:NUM:( )'
{-j,--smart-case}'[Perform case insensitive matching, unless a pattern is specified with a literal upper case ASCII letter]'
Expand All @@ -72,22 +75,22 @@ local arguments=(
--label=-'[Displays the LABEL value when input is read from standard input where a file name would normally be printed in the output]'
--line-buffered'[Force output to be line buffered instead of block buffered]'
--lines'[Boolean line matching mode for option --bool, the default mode]'
{-M,--file-magic=-}'[Only search files matching the magic signature pattern MAGIC]:PATTERN:( )'
'(1)*'{-M,--file-magic=-}'[Only search files matching the magic signature pattern MAGIC]:PATTERN:( )'
{-m,--min-count=-,--max-count=-}'[Require MIN matches, stop after MAX matches when specified]:MIN,MAX:( )::(1 1, 1,10)'
--match'[Match all input]'
--max-files=-'[Restrict the number of files matched to NUM]'
--mmap'[Use memory maps to search files]'
{-N,--neg-regexp=-}'[Specify a negative PATTERN to reject specific -e PATTERN matches with a counter pattern]:PATTERN:( )'
{-n,--line-number}'[Each output line is preceded by its relative line number in the file, starting at line 1]'
--not'[Specifies that PATTERN should not match]'
{-O,--file-extension=-}'[Only search files whose filename extensions match the specified comma-separated list of EXTENSIONS, same as -g *.ext for each]:EXT:( )'
'(1)*'{-O,--file-extension=-}'[Only search files whose filename extensions match the specified comma-separated list of EXTENSIONS, same as -g *.ext for each]:EXT:( )'
{-o,--only-matching}'[Only the matching part of a pattern match is output]'
--only-line-number'[Only the line number of a matching line is output]'
{--files,-%%}'[Boolean file matching mode, the opposite of --lines]'
{-P,--perl-regexp}'[Interpret PATTERN as a Perl regular expression using PCRE2]'
$matchers{-P,--perl-regexp}'[Interpret PATTERN as a Perl regular expression using PCRE2]'
{-p,--no-dereference}'[If -R or -r is specified, do not follow symbolic links, even when symbolic links are specified on the command line]'
--pager'[When output is sent to the terminal, uses COMMAND to page through the output]'
--pretty'[When output is sent to a terminal, enables --color, --heading, -n, --sort=-, --tree and -T when not explicitly disabled]:KEY:(name best size changed created used rname rbest rsize rchanged rcreated rused)'
--pretty'[When output is sent to a terminal, enables --color, --heading, -n, --sort, --tree and -T when not explicitly disabled]'
{-Q,--query}'[Query mode: start a TUI to perform interactive searches]'
{-q,--quiet,--silent}'[Quiet mode: suppress all output]'
{-R,--dereference-recursive}'[Recursively read all files under each directory, following symbolic links to files and directories, unlike -r]'
Expand All @@ -101,7 +104,7 @@ local arguments=(
--sort=-'[Displays matching files in the order specified by KEY in recursive searches]:KEY:(name best size changed created used rname rbest rsize rchanged rcreated rused)'
--stats'[Output statistics on the number of files and directories searched and the inclusion and exclusion constraints applied]'
{-T,--initial-tab}'[Add a tab space to separate the file name, line number, column number and byte offset with the matched line]'
{-t,--file-type=-}'[Search only files associated with TYPES, a comma-separated list of file types]:TYPES:(actionscript ada asm asp aspx autoconf automake awk Awk basic batch bison c c++ clojure cpp csharp css csv dart Dart delphi elisp elixir erlang fortran gif Gif go groovy gsp haskell html jade java jpeg Jpeg js json jsp julia kotlin less lex lisp lua m4 make markdown matlab node Node objc objc++ ocaml parrot pascal pdf Pdf perl Perl php Php png Png prolog python Python r rpm Rpm rst rtf Rtf ruby Ruby rust scala scheme shell Shell smalltalk sql svg swift tcl tex text tiff Tiff tt typescript verilog vhdl vim xml Xml yacc yaml zig )'
'(1)*'{-t,--file-type=-}'[Search only files associated with TYPES, a comma-separated list of file types]:TYPES:(actionscript ada asm asp aspx autoconf automake awk Awk basic batch bison c c++ clojure cpp csharp css csv dart Dart delphi elisp elixir erlang fortran gif Gif go groovy gsp haskell html jade java jpeg Jpeg js json jsp julia kotlin less lex lisp lua m4 make markdown matlab node Node objc objc++ ocaml parrot pascal pdf Pdf perl Perl php Php png Png prolog python Python r rpm Rpm rst rtf Rtf ruby Ruby rust scala scheme shell Shell smalltalk sql svg swift tcl tex text tiff Tiff tt typescript verilog vhdl vim xml Xml yacc yaml zig )'
--tabs'[Set the tab size to NUM to expand tabs for option -k]'
--tag'[Disables colors to mark up matches with TAG]'
{--tree,-^}'[Output directories with matching files in a tree-like format for option -c or --count, -l or --files-with-matches, -L or --files-without-match]'
Expand All @@ -118,10 +121,9 @@ local arguments=(
--xml'[Output file matches in XML]'
{-Y,--empty}'[Permits empty matches]'
{-y,--any-line,--passthru}'[Any line is output (passthru)]'
{-Z-,--fuzzy=-}'[Fuzzy mode: report approximate pattern matches within MAX errors]:DIST:(1 +1 -1 \~1 +-1 +~1 +-~1 -~1 best1 best+1 best-1 best~1 best+-1 best+~1 best+-~1 best-~1)'
$matchers{-Z-,--fuzzy=-}'[Fuzzy mode: report approximate pattern matches within MAX errors]:DIST:(1 +1 -1 \~1 +-1 +~1 +-~1 -~1 best1 best+1 best-1 best~1 best+-1 best+~1 best+-~1 best-~1)'
{-z,--decompress}'[Search compressed files and archives]'
--zmax=-'[When used with option -z (--decompress), searches the contents of compressed files and archives stored within archives by up to NUM expansion stages]'
{-0,--null}'[Output a zero-byte (NUL) after the file name]'
'*:filename:_files'
)
_arguments -s -S $arguments
Loading

0 comments on commit 994ccba

Please sign in to comment.