231218.2 · 0bdc215d78b87ec183490df4096b4a9c1c738b5c
released 4.4.0
- installs bash autocompletion #327
- installs fish and zsh autocompletions #198
- TUI ALT-SHIFT-% switches between "bool lines" mode, "bool files" mode and off
- TUI boolF mode (`-%FQ`) now applies syntax highlighting
- option `-t` (`--file-type`) now also accepts filename extensions as shortcuts, when unambiguous, for example `-tpy` for `-tpython` #333
- support legacy grep long options without `=` for option arguments, like GNU grep does
reading declarations
@@ -3886,8 +3886,8 @@ in markdown: The default pattern syntax is an extended form of the POSIX ERE syntax, same as option -E (--extended-regexp). Try ug --help regex for help with pattern syntax and how to use logical connectives to specify Boolean- search queries with option -% (--bool) to match lines and -%% (--files- --bool) to match files. Options -F (--fixed-strings), -G (--basic-+ search queries with option -% (--bool) to match lines and -%% (--bool+ --files) to match files. Options -F (--fixed-strings), -G (--basic- regexp) and -P (--perl-regexp) specify other pattern syntaxes. Option -i (--ignore-case) ignores case in ASCII patterns. When combined@@ -3984,15 +3984,15 @@ in markdown: garbage to the terminal, which can have problematic consequences if the terminal driver interprets some of it as commands. - --and [-e] PATTERN ... -e PATTERN- Specify additional patterns to match. Patterns must be specified- with -e. Each -e PATTERN following this option is considered an- alternative pattern to match, i.e. each -e is interpreted as an OR- pattern. For example, -e A -e B --and -e C -e D matches lines- with (`A' or `B') and (`C' or `D'). Note that multiple -e PATTERN- are alternations that bind more tightly together than --and.- Option --stats displays the search patterns applied. See also- options --not, --andnot, --bool, --files and --lines.+ --and [-e] PATTERN+ Specify additional PATTERN that must match. Additional -e PATTERN+ following this option is considered an alternative pattern to+ match, i.e. each -e is interpreted as an OR pattern enclosed+ within the AND. For example, -e A -e B --and -e C -e D matches+ lines with (`A' or `B') and (`C' or `D'). Note that multiple -e+ PATTERN are alternations that bind more tightly together than+ --and. Option --stats displays the search patterns applied. See+ also options --not, --andnot, --bool, --files and --lines. --andnot [-e] PATTERN Combines --and --not. See also options --and, --not and --bool.@@ -4005,11 +4005,11 @@ in markdown: and -y. -b, --byte-offset- The offset in bytes of a matched line is displayed in front of the- respective matched line. If -u is specified, displays the offset- for each pattern matched on the same line. Byte offsets are exact- for ASCII, UTF-8 and raw binary input. Otherwise, the byte offset- in the UTF-8 normalized input is displayed.+ The offset in bytes of a pattern match is displayed in front of+ the respective matched line. When -u is specified, displays the+ offset for each pattern matched on the same line. Byte offsets+ are exact for ASCII, UTF-8 and raw binary input. Otherwise, the+ byte offset in the UTF-8 normalized input is displayed. --binary-files=TYPE Controls searching and reporting pattern matches in binary files.@@ -4044,10 +4044,10 @@ in markdown: unless -F is specified. Options -E, -F, -G, -P and -Z can be combined with --bool to match subpatterns as strings or regular expressions (-E is the default.) This option does not apply to -f- FILE patterns. The double short option -%% enables options- --bool --files. Option --stats displays the Boolean search- patterns applied. See also options --and, --andnot, --not,- --files and --lines.+ FILE patterns. The double short option -%% enables options --bool+ --files. Option --stats displays the Boolean search patterns+ applied. See also options --and, --andnot, --not, --files and+ --lines. --break Adds a line break between results from different files. This@@ -4069,10 +4069,10 @@ in markdown: outputs directories in a tree-like format. --color[=WHEN], --colour[=WHEN]- Mark up the matching text with the expression stored in the- GREP_COLOR or GREP_COLORS environment variable. WHEN can be- `never', `always', or `auto', where `auto' marks up matches only- when output on a terminal. The default is `auto'.+ Mark up the matching text with the colors specified with option+ --colors or the GREP_COLOR or GREP_COLORS environment variable.+ WHEN can be `never', `always', or `auto', where `auto' marks up+ matches only when output on a terminal. The default is `auto'. --colors=COLORS, --colours=COLORS Use COLORS to mark up text. COLORS is a colon-separated list of@@ -4128,7 +4128,7 @@ in markdown: --delay=DELAY Set the default -Q key response delay. Default is 3 for 300ms. - --depth=[MIN,][MAX], -1, -2, -3, ... -9, -10, -11, -12, ...+ --depth=[MIN,][MAX], -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. The short forms -3 -5, -3-5 and -3,5 search@@ -4143,13 +4143,12 @@ in markdown: the default. -e PATTERN, --regexp=PATTERN- Specify a PATTERN used during the search of the input: an input- line is selected if it matches any of the specified patterns.- Note that longer patterns take precedence over shorter patterns.- This option is most useful when multiple -e options are used to- specify multiple patterns, when a pattern begins with a dash- (`-'), to specify a pattern after option -f or after the FILE- arguments.+ Specify a PATTERN to search the input. An input line is selected+ if it matches any of the specified patterns. Note that longer+ patterns take precedence over shorter patterns. This option is+ most useful when multiple -e options are used to specify multiple+ patterns, when a pattern begins with a dash (`-'), to specify a+ pattern after option -f or after the FILE arguments. --encoding=ENCODING The encoding format of the input. The default ENCODING is binary@@ -4166,15 +4165,14 @@ in markdown: `KOI8-R', `KOI8-U', `KOI8-RU'. --exclude=GLOB- Skip files whose name matches GLOB using wildcard matching, same- as -g ^GLOB. GLOB can use **, *, ?, and [...] as wildcards and \- to quote a wildcard or backslash character literally. When GLOB- contains a `/', full pathnames are matched. Otherwise basenames- are matched. When GLOB ends with a `/', directories are excluded- as if --exclude-dir is specified. Otherwise files are excluded.- Note that --exclude patterns take priority over --include- patterns. GLOB should be quoted to prevent shell globbing. This- option may be repeated.+ Exclude files whose name matches GLOB, same as -g ^GLOB. GLOB can+ use **, *, ?, and [...] as wildcards and \ to quote a wildcard or+ backslash character literally. When GLOB contains a `/', full+ pathnames are matched. Otherwise basenames are matched. When+ GLOB ends with a `/', directories are excluded as if --exclude-dir+ is specified. Otherwise files are excluded. Note that --exclude+ patterns take priority over --include patterns. GLOB should be+ quoted to prevent shell globbing. This option may be repeated. --exclude-dir=GLOB Exclude directories whose name matches GLOB from recursive@@ -4199,10 +4197,10 @@ in markdown: may be repeated. --exclude-fs=MOUNTS- Exclude file systems specified by MOUNTS from recursive searches,- MOUNTS is a comma-separated list of mount points or pathnames of- directories on file systems. Note that --exclude-fs mounts take- priority over --include-fs mounts. This option may be repeated.+ Exclude file systems specified by MOUNTS from recursive searches.+ MOUNTS is a comma-separated list of mount points or pathnames to+ directories. Note that --exclude-fs=MOUNTS take priority over+ --include-fs=MOUNTS. This option may be repeated. -F, --fixed-strings Interpret pattern as a set of fixed strings, separated by@@ -4257,12 +4255,11 @@ in markdown: Spacing (blanks and tabs) in regular expressions are ignored. -G, --basic-regexp- Interpret patterns as basic regular expressions (BREs), i.e. make- ugrep behave as traditional grep.+ Interpret patterns as basic regular expressions (BREs). -g GLOBS, --glob=GLOBS, --iglob=GLOBS- Search only files whose name matches the specified comma-separated- list of GLOBS, same as --include='glob' for each `glob' in GLOBS.+ Only search files whose name matches the specified comma-separated+ list of GLOBS, same as --include=glob for each `glob' in GLOBS. When a `glob' is preceded by a `!' or a `^', skip files whose name matches `glob', same as --exclude='glob'. When `glob' contains a `/', full pathnames are matched. Otherwise basenames are matched.@@ -4345,15 +4342,14 @@ in markdown: specify additional files. --include=GLOB- Search only files whose name matches GLOB using wildcard matching,- same as -g GLOB. GLOB can use **, *, ?, and [...] as wildcards- and \ to quote a wildcard or backslash character literally. When- GLOB contains a `/', full pathnames are matched. Otherwise- basenames are matched. When GLOB ends with a `/', directories are- included as if --include-dir is specified. Otherwise files are- included. Note that --exclude patterns take priority over- --include patterns. GLOB should be quoted to prevent shell- globbing. This option may be repeated.+ Only search files whose name matches GLOB, same as -g GLOB. GLOB+ can use **, *, ?, and [...] as wildcards and \ to quote a wildcard+ or backslash character literally. When GLOB contains a `/', full+ pathnames are matched. Otherwise basenames are matched. When+ GLOB ends with a `/', directories are included as if --include-dir+ is specified. Otherwise files are included. Note that --exclude+ patterns take priority over --include patterns. GLOB should be+ quoted to prevent shell globbing. This option may be repeated. --include-dir=GLOB Only directories whose name matches GLOB are included in recursive@@ -4380,10 +4376,10 @@ in markdown: --include-fs=MOUNTS Only file systems specified by MOUNTS are included in recursive searches. MOUNTS is a comma-separated list of mount points or- pathnames of directories on file systems. --include-fs=.- restricts recursive searches to the file system of the working- directory only. Note that --exclude-fs mounts take priority over- --include-fs mounts. This option may be repeated.+ pathnames to directories. --include-fs=. restricts recursive+ searches to the file system of the working directory only. Note+ that --exclude-fs=MOUNTS take priority over --include-fs=MOUNTS.+ This option may be repeated. --index Perform index-based recursive search. This option assumes, but@@ -4405,8 +4401,8 @@ in markdown: same order as specified. -j, --smart-case- Perform case insensitive matching like option -i, unless a pattern- is specified with a literal ASCII upper case letter.+ Perform case insensitive matching, unless a pattern is specified+ with a literal upper case ASCII letter. --json Output file matches in JSON. If -H, -n, -k, or -b is specified, additional values are output. See also options --format and -u.@@ -4415,9 +4411,9 @@ in markdown: Start searching at line MIN, stop at line MAX when specified. -k, --column-number- The column number of a matched pattern is displayed in front of- the respective matched line, starting at column 1. Tabs are- expanded when columns are counted, see also option --tabs.+ The column number of a pattern match is displayed in front of the+ respective matched line, starting at column 1. Tabs are expanded+ in counting columns, see also option --tabs. -L, --files-without-match Only the names of files not containing selected lines are written@@ -4447,7 +4443,7 @@ in markdown: Boolean line matching mode for option --bool, the default mode. -M MAGIC, --file-magic=MAGIC- Only files matching the signature pattern MAGIC are searched. The+ Only search files matching the magic signature pattern MAGIC. The signature "magic bytes" at the start of a file are compared to the MAGIC regex pattern. When matching, the file will be searched. When MAGIC is preceded by a `!' or a `^', skip files with matching@@ -4475,13 +4471,11 @@ in markdown: specified, use up to MAX mmap memory per thread. -N PATTERN, --neg-regexp=PATTERN- Specify a negative PATTERN used during the search of the input: an- input line is selected only if it matches the specified patterns- unless it matches the negative PATTERN. Same as -e (?^PATTERN).- Negative pattern matches are essentially removed before any other- patterns are matched. Note that longer patterns take precedence- over shorter patterns. Option -N cannot be specified with -P.- This option may be repeated.+ Specify a negative PATTERN to reject pattern matches that also+ match PATTERN. Note that longer patterns take precedence over+ shorter patterns, i.e. a negative pattern must be of the same+ length or longer to reject matching patterns. Option -N cannot be+ specified with -P. This option may be repeated. -n, --line-number Each output line is preceded by its relative line number in the@@ -4500,23 +4494,21 @@ in markdown: --and, --andnot, --bool, --files and --lines. -O EXTENSIONS, --file-extension=EXTENSIONS- Search only files whose filename extensions match the specified- comma-separated list of EXTENSIONS, same as --include='*.ext' for- each `ext' in EXTENSIONS. When an `ext' is preceded by a `!' or a- `^', skip files whose filename extensions matches `ext', same as- --exclude='*.ext'. This option may be repeated and may be- combined with options -g, -M and -t to expand the recursive- search.+ Only search files whose filename extensions match the specified+ comma-separated list of EXTENSIONS, same as -g '*.ext' for each+ `ext' in EXTENSIONS. When an `ext' is preceded by a `!' or a `^',+ skip files whose filename extensions matches `ext', same as -g+ '^*.ext'. This option may be repeated and may be combined with+ options -g, -M and -t to expand the recursive search. -o, --only-matching- Output only the matching part of lines. If -A, -B or -C is- specified, fits the match and its context on a line within the- specified number of columns.+ Only the matching part of a pattern match is output. If -A, -B or+ -C is specified, fits the match and its context on a line within+ the specified number of columns. --only-line-number- The line number of the matching line in the file is output without- displaying the match. The line number counter is reset for each- file processed.+ Only the line number of a matching line is output. The line+ number counter is reset for each file processed. --files, -%% Boolean file matching mode, the opposite of --lines. When@@ -4570,8 +4562,8 @@ in markdown: has been found. -R, --dereference-recursive- Recursively read all files under each directory. Follow symbolic- links to files and directories, unlike -r.+ Recursively read all files under each directory, following+ symbolic links to files and directories, unlike -r. -r, --recursive Recursively read all files under each directory, following@@ -4580,18 +4572,18 @@ in markdown: terminal, recursive searches are performed as if -r is specified. --replace=FORMAT- Replace matching patterns in the output by the specified FORMAT- with `%' fields. If -P is specified, FORMAT may include `%1' to- `%9', `%[NUM]#' and `%[NAME]#' to output group captures. A `%%'- outputs `%' and `%~' outputs a newline. See option --format,- `ugrep --help format' and `man ugrep' section FORMAT for details.+ Replace matching patterns in the output by FORMAT with `%' fields.+ If -P is specified, FORMAT may include `%1' to `%9', `%[NUM]#' and+ `%[NAME]#' to output group captures. A `%%' outputs `%' and `%~'+ outputs a newline. See also option --format, `ugrep --help+ format' and `man ugrep' section FORMAT for details. -S, --dereference-files When -r is specified, follow symbolic links to files, but not to directories. The default is not to follow symbolic links. -s, --no-messages- Silent mode: nonexistent and unreadable files are ignored, i.e.+ Silent mode: nonexistent and unreadable files are ignored and their error messages and warnings are suppressed. --save-config[=FILE] [OPTIONS]@@ -4744,7 +4736,7 @@ in markdown: Any line is output (passthru). Non-matching lines are output as context with a `-' separator. See also options -A, -B and -C. - -Z[best][+-~][MAX], --fuzzy=[best][+-~][MAX]+ -Z[best][+-~][MAX], --fuzzy[=[best][+-~][MAX]] Fuzzy mode: report approximate pattern matches within MAX errors. The default is -Z1: one deletion, insertion or substitution is allowed. If `+`, `-' and/or `~' is specified, then `+' allows@@ -4780,14 +4772,13 @@ in markdown: --zmax=NUM When used with option -z (--decompress), searches the contents of compressed files and archives stored within archives by up to NUM- expansion levels deep. The default --zmax=1 only permits- searching uncompressed files stored in cpio, pax, tar and zip- archives; compressed files and archives are detected as binary- files and are effectively ignored. Specify --zmax=2 to search- compressed files and archives stored in cpio, pax, tar and zip- archives. NUM may range from 1 to 99 for up to 99 decompression- and de-archiving steps. Increasing NUM values gradually degrades- performance.+ expansion stages. The default --zmax=1 only permits searching+ uncompressed files stored in cpio, pax, tar and zip archives;+ compressed files and archives are detected as binary files and are+ effectively ignored. Specify --zmax=2 to search compressed files+ and archives stored in cpio, pax, tar and zip archives. NUM may+ range from 1 to 99 for up to 99 decompression and de-archiving+ steps. Increasing NUM values gradually degrades performance. -0, --null Output a zero-byte (NUL) after the file name. This option can be@@ -5356,7 +5347,7 @@ in markdown: - ugrep 4.3.6 December 7, 2023 UGREP(1)+ ugrep 4.4.0 December 18, 2023 UGREP(1) 🔝 [Back to table of contents](#toc)
completions/fish/compgen
@@ -25,6 +25,7 @@ export ENCODING=$($UGREP --encoding=list 2>&1 | sed -e 's/^.[a-z].*are//' -e '/h # add -xa 'arguments' to --hexdump # add -xa 'arguments' to --sort=KEY # add -xa 'arguments' to --fuzzy=+# add -r to -e, -f, -g, -J, -K, -M, -m, -N, -O $UGREP --help 2>&1 \ | sed -E -e '/^[ ]{4}-/s/ -([^-])([[ ][^ ]*|,|$)/ -s \1/g' -e $'/^[ ]{4}-/s/ -([^-][^-, ]+)/ -o \'\\1\'/g' -e '/^[ ]{4}-/s/--([-a-z]+)[^ ]*/-l \1/g' -e '/^[ ]{4}-/s/$/ -d/' \ | sed -E -e '/^[ ]{4}-/s/ \[-e\] PATTERN| \[OPTIONS\]| \[WHAT\]| \.\.\.|,//g' \@@ -37,6 +38,7 @@ $UGREP --help 2>&1 \ | sed -e "s/^-l hexdump /&-xa '1a 2a 4ah 6ah 8ah 1aC1 2aC1 4ahC1 6ahC1 8ahC1' /" \ | sed -e "s/^-l sort /&-xa 'name best size changed created used rname rbest rsize rchanged rcreated rused' /" \ | sed -e "s/^-s Z -l fuzzy /&-xa '1 +1 -1 ~1 +-1 +~1 +-~1 -~1 best1 best+1 best-1 best~1 best+-1 best+~1 best+-~1 best-~1' /" \+ | sed -e "s/^-s [efgJKMmNO]/& -r/" \ >> ug.tmp cat ug.tmp | sed -e '/^[^#]/s/^/complete -c ug /' > ug.fish
@@ -23,20 +23,20 @@ complete -c ug+ -l delay -d 'Set the default -Q key response delay' complete -c ug+ -l depth -s 1 -s 2 -s 3 -s 9 -o '10' -o '11' -d 'Restrict recursive searches from MIN to MAX directory levels deep, where -1 (--depth=1) searches the specified path without recursing into subdirectories' complete -c ug+ -l dotall -d 'Dot . in regular expressions matches anything, including newline.' complete -c ug+ -s E -l extended-regexp -d 'Interpret patterns as extended regular expressions (EREs)'-complete -c ug+ -s e -l regexp -d 'Specify a PATTERN to search the input'+complete -c ug+ -s e -r -l regexp -d 'Specify a PATTERN to search the input' complete -c ug+ -l encoding -xa '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 ' -d 'The encoding format of the input' complete -c ug+ -l exclude -d 'Exclude files whose name matches GLOB, same as -g ^GLOB' complete -c ug+ -l exclude-dir -d 'Exclude directories whose name matches GLOB from recursive searches, same as -g ^GLOB/' complete -c ug+ -l exclude-from -d 'Read the globs from FILE and skip files and directories whose name matches one or more globs' complete -c ug+ -l exclude-fs -d 'Exclude file systems specified by MOUNTS from recursive searches' complete -c ug+ -s F -l fixed-strings -d 'Interpret pattern as a set of fixed strings, separated by newlines, any of which is to be matched'-complete -c ug+ -s f -l file -d 'Read newline-separated patterns from FILE'+complete -c ug+ -s f -r -l file -d 'Read newline-separated patterns from FILE' complete -c ug+ -l filter -d 'Filter files through the specified COMMANDS first before searching' complete -c ug+ -l filter-magic-label -d 'Associate LABEL with files whose signature "magic bytes" match the MAGIC regex pattern' complete -c ug+ -l format -d 'Output FORMAT-formatted matches' complete -c ug+ -l free-space -d 'Spacing (blanks and tabs) in regular expressions are ignored' complete -c ug+ -s G -l basic-regexp -d 'Interpret patterns as basic regular expressions (BREs)'-complete -c ug+ -s g -l glob -l iglob -d 'Only search files whose name matches the specified comma-separated list of GLOBS, same as --include=glob for each glob in GLOBS'+complete -c ug+ -s g -r -l glob -l iglob -d 'Only search files whose name matches the specified comma-separated list of GLOBS, same as --include=glob for each glob in GLOBS' complete -c ug+ -l glob-ignore-case -d 'Perform case-insensitive glob matching in general' complete -c ug+ -l group-separator -d 'Use SEP as a group separator for context options -A, -B and -C' complete -c ug+ -s H -l with-filename -d 'Always print the filename with output lines'@@ -54,26 +54,26 @@ complete -c ug+ -l include-dir -d 'Only directories whose name matches GLOB are complete -c ug+ -l include-from -d 'Read the globs from FILE and search only files and directories whose name matches one or more globs' complete -c ug+ -l include-fs -d 'Only file systems specified by MOUNTS are included in recursive searches' complete -c ug+ -l index -d 'Perform index-based recursive search'-complete -c ug+ -s J -l jobs -d 'Specifies the number of threads spawned to search files'+complete -c ug+ -s J -r -l jobs -d 'Specifies the number of threads spawned to search files' complete -c ug+ -s j -l smart-case -d 'Perform case insensitive matching, unless a pattern is specified with a literal upper case ASCII letter' complete -c ug+ -l json -d 'Output file matches in JSON'-complete -c ug+ -s K -l range -l min-line -l max-line -d 'Start searching at line MIN, stop at line MAX when specified'+complete -c ug+ -s K -r -l range -l min-line -l max-line -d 'Start searching at line MIN, stop at line MAX when specified' complete -c ug+ -s k -l column-number -d 'The column number of a pattern match is displayed in front of the respective matched line, starting at column 1' complete -c ug+ -s L -l files-without-match -d 'Only the names of files not containing selected lines are written to standard output' complete -c ug+ -s l -l files-with-matches -d 'Only the names of files containing selected lines are written to standard output' complete -c ug+ -l label -d 'Displays the LABEL value when input is read from standard input where a file name would normally be printed in the output' complete -c ug+ -l line-buffered -d 'Force output to be line buffered instead of block buffered' complete -c ug+ -l lines -d 'Boolean line matching mode for option --bool, the default mode'-complete -c ug+ -s M -l file-magic -d 'Only search files matching the magic signature pattern MAGIC'-complete -c ug+ -s m -l min-count -l max-count -d 'Require MIN matches, stop after MAX matches when specified'+complete -c ug+ -s M -r -l file-magic -d 'Only search files matching the magic signature pattern MAGIC'+complete -c ug+ -s m -r -l min-count -l max-count -d 'Require MIN matches, stop after MAX matches when specified' complete -c ug+ -l match -d 'Match all input' complete -c ug+ -l max-files -d 'Restrict the number of files matched to NUM' complete -c ug+ -l mmap -d 'Use memory maps to search files'-complete -c ug+ -s N -l neg-regexp -d 'Specify a negative PATTERN to reject pattern matches that also match PATTERN'+complete -c ug+ -s N -r -l neg-regexp -d 'Specify a negative PATTERN to reject pattern matches that also match PATTERN' complete -c ug+ -s n -l line-number -d 'Each output line is preceded by its relative line number in the file, starting at line 1' complete -c ug+ -l no-group-separator -d 'Removes the group separator line from the output for context options -A, -B and -C' complete -c ug+ -l not -d 'Specifies that PATTERN should not match'-complete -c ug+ -s O -l file-extension -d 'Only search files whose filename extensions match the specified comma-separated list of EXTENSIONS, same as -g *.ext for each'+complete -c ug+ -s O -r -l file-extension -d 'Only search files whose filename extensions match the specified comma-separated list of EXTENSIONS, same as -g *.ext for each' complete -c ug+ -s o -l only-matching -d 'Only the matching part of a pattern match is output' complete -c ug+ -l only-line-number -d 'Only the line number of a matching line is output' complete -c ug+ -l files -o '%%' -d 'Boolean file matching mode, the opposite of --lines'
@@ -23,20 +23,20 @@ complete -c ug -l delay -d 'Set the default -Q key response delay' complete -c ug -l depth -s 1 -s 2 -s 3 -s 9 -o '10' -o '11' -d 'Restrict recursive searches from MIN to MAX directory levels deep, where -1 (--depth=1) searches the specified path without recursing into subdirectories' complete -c ug -l dotall -d 'Dot . in regular expressions matches anything, including newline.' complete -c ug -s E -l extended-regexp -d 'Interpret patterns as extended regular expressions (EREs)'-complete -c ug -s e -l regexp -d 'Specify a PATTERN to search the input'+complete -c ug -s e -r -l regexp -d 'Specify a PATTERN to search the input' complete -c ug -l encoding -xa '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 ' -d 'The encoding format of the input' complete -c ug -l exclude -d 'Exclude files whose name matches GLOB, same as -g ^GLOB' complete -c ug -l exclude-dir -d 'Exclude directories whose name matches GLOB from recursive searches, same as -g ^GLOB/' complete -c ug -l exclude-from -d 'Read the globs from FILE and skip files and directories whose name matches one or more globs' complete -c ug -l exclude-fs -d 'Exclude file systems specified by MOUNTS from recursive searches' complete -c ug -s F -l fixed-strings -d 'Interpret pattern as a set of fixed strings, separated by newlines, any of which is to be matched'-complete -c ug -s f -l file -d 'Read newline-separated patterns from FILE'+complete -c ug -s f -r -l file -d 'Read newline-separated patterns from FILE' complete -c ug -l filter -d 'Filter files through the specified COMMANDS first before searching' complete -c ug -l filter-magic-label -d 'Associate LABEL with files whose signature "magic bytes" match the MAGIC regex pattern' complete -c ug -l format -d 'Output FORMAT-formatted matches' complete -c ug -l free-space -d 'Spacing (blanks and tabs) in regular expressions are ignored' complete -c ug -s G -l basic-regexp -d 'Interpret patterns as basic regular expressions (BREs)'-complete -c ug -s g -l glob -l iglob -d 'Only search files whose name matches the specified comma-separated list of GLOBS, same as --include=glob for each glob in GLOBS'+complete -c ug -s g -r -l glob -l iglob -d 'Only search files whose name matches the specified comma-separated list of GLOBS, same as --include=glob for each glob in GLOBS' complete -c ug -l glob-ignore-case -d 'Perform case-insensitive glob matching in general' complete -c ug -l group-separator -d 'Use SEP as a group separator for context options -A, -B and -C' complete -c ug -s H -l with-filename -d 'Always print the filename with output lines'@@ -54,26 +54,26 @@ complete -c ug -l include-dir -d 'Only directories whose name matches GLOB are i complete -c ug -l include-from -d 'Read the globs from FILE and search only files and directories whose name matches one or more globs' complete -c ug -l include-fs -d 'Only file systems specified by MOUNTS are included in recursive searches' complete -c ug -l index -d 'Perform index-based recursive search'-complete -c ug -s J -l jobs -d 'Specifies the number of threads spawned to search files'+complete -c ug -s J -r -l jobs -d 'Specifies the number of threads spawned to search files' complete -c ug -s j -l smart-case -d 'Perform case insensitive matching, unless a pattern is specified with a literal upper case ASCII letter' complete -c ug -l json -d 'Output file matches in JSON'-complete -c ug -s K -l range -l min-line -l max-line -d 'Start searching at line MIN, stop at line MAX when specified'+complete -c ug -s K -r -l range -l min-line -l max-line -d 'Start searching at line MIN, stop at line MAX when specified' complete -c ug -s k -l column-number -d 'The column number of a pattern match is displayed in front of the respective matched line, starting at column 1' complete -c ug -s L -l files-without-match -d 'Only the names of files not containing selected lines are written to standard output' complete -c ug -s l -l files-with-matches -d 'Only the names of files containing selected lines are written to standard output' complete -c ug -l label -d 'Displays the LABEL value when input is read from standard input where a file name would normally be printed in the output' complete -c ug -l line-buffered -d 'Force output to be line buffered instead of block buffered' complete -c ug -l lines -d 'Boolean line matching mode for option --bool, the default mode'-complete -c ug -s M -l file-magic -d 'Only search files matching the magic signature pattern MAGIC'-complete -c ug -s m -l min-count -l max-count -d 'Require MIN matches, stop after MAX matches when specified'+complete -c ug -s M -r -l file-magic -d 'Only search files matching the magic signature pattern MAGIC'+complete -c ug -s m -r -l min-count -l max-count -d 'Require MIN matches, stop after MAX matches when specified' complete -c ug -l match -d 'Match all input' complete -c ug -l max-files -d 'Restrict the number of files matched to NUM' complete -c ug -l mmap -d 'Use memory maps to search files'-complete -c ug -s N -l neg-regexp -d 'Specify a negative PATTERN to reject pattern matches that also match PATTERN'+complete -c ug -s N -r -l neg-regexp -d 'Specify a negative PATTERN to reject pattern matches that also match PATTERN' complete -c ug -s n -l line-number -d 'Each output line is preceded by its relative line number in the file, starting at line 1' complete -c ug -l no-group-separator -d 'Removes the group separator line from the output for context options -A, -B and -C' complete -c ug -l not -d 'Specifies that PATTERN should not match'-complete -c ug -s O -l file-extension -d 'Only search files whose filename extensions match the specified comma-separated list of EXTENSIONS, same as -g *.ext for each'+complete -c ug -s O -r -l file-extension -d 'Only search files whose filename extensions match the specified comma-separated list of EXTENSIONS, same as -g *.ext for each' complete -c ug -s o -l only-matching -d 'Only the matching part of a pattern match is output' complete -c ug -l only-line-number -d 'Only the line number of a matching line is output' complete -c ug -l files -o '%%' -d 'Boolean file matching mode, the opposite of --lines'
@@ -23,20 +23,20 @@ complete -c ugrep+ -l delay -d 'Set the default -Q key response delay' complete -c ugrep+ -l depth -s 1 -s 2 -s 3 -s 9 -o '10' -o '11' -d 'Restrict recursive searches from MIN to MAX directory levels deep, where -1 (--depth=1) searches the specified path without recursing into subdirectories' complete -c ugrep+ -l dotall -d 'Dot . in regular expressions matches anything, including newline.' complete -c ugrep+ -s E -l extended-regexp -d 'Interpret patterns as extended regular expressions (EREs)'-complete -c ugrep+ -s e -l regexp -d 'Specify a PATTERN to search the input'+complete -c ugrep+ -s e -r -l regexp -d 'Specify a PATTERN to search the input' complete -c ugrep+ -l encoding -xa '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 ' -d 'The encoding format of the input' complete -c ugrep+ -l exclude -d 'Exclude files whose name matches GLOB, same as -g ^GLOB' complete -c ugrep+ -l exclude-dir -d 'Exclude directories whose name matches GLOB from recursive searches, same as -g ^GLOB/' complete -c ugrep+ -l exclude-from -d 'Read the globs from FILE and skip files and directories whose name matches one or more globs' complete -c ugrep+ -l exclude-fs -d 'Exclude file systems specified by MOUNTS from recursive searches' complete -c ugrep+ -s F -l fixed-strings -d 'Interpret pattern as a set of fixed strings, separated by newlines, any of which is to be matched'-complete -c ugrep+ -s f -l file -d 'Read newline-separated patterns from FILE'+complete -c ugrep+ -s f -r -l file -d 'Read newline-separated patterns from FILE' complete -c ugrep+ -l filter -d 'Filter files through the specified COMMANDS first before searching' complete -c ugrep+ -l filter-magic-label -d 'Associate LABEL with files whose signature "magic bytes" match the MAGIC regex pattern' complete -c ugrep+ -l format -d 'Output FORMAT-formatted matches' complete -c ugrep+ -l free-space -d 'Spacing (blanks and tabs) in regular expressions are ignored' complete -c ugrep+ -s G -l basic-regexp -d 'Interpret patterns as basic regular expressions (BREs)'-complete -c ugrep+ -s g -l glob -l iglob -d 'Only search files whose name matches the specified comma-separated list of GLOBS, same as --include=glob for each glob in GLOBS'+complete -c ugrep+ -s g -r -l glob -l iglob -d 'Only search files whose name matches the specified comma-separated list of GLOBS, same as --include=glob for each glob in GLOBS' complete -c ugrep+ -l glob-ignore-case -d 'Perform case-insensitive glob matching in general' complete -c ugrep+ -l group-separator -d 'Use SEP as a group separator for context options -A, -B and -C' complete -c ugrep+ -s H -l with-filename -d 'Always print the filename with output lines'@@ -54,26 +54,26 @@ complete -c ugrep+ -l include-dir -d 'Only directories whose name matches GLOB a complete -c ugrep+ -l include-from -d 'Read the globs from FILE and search only files and directories whose name matches one or more globs' complete -c ugrep+ -l include-fs -d 'Only file systems specified by MOUNTS are included in recursive searches' complete -c ugrep+ -l index -d 'Perform index-based recursive search'-complete -c ugrep+ -s J -l jobs -d 'Specifies the number of threads spawned to search files'+complete -c ugrep+ -s J -r -l jobs -d 'Specifies the number of threads spawned to search files' complete -c ugrep+ -s j -l smart-case -d 'Perform case insensitive matching, unless a pattern is specified with a literal upper case ASCII letter' complete -c ugrep+ -l json -d 'Output file matches in JSON'-complete -c ugrep+ -s K -l range -l min-line -l max-line -d 'Start searching at line MIN, stop at line MAX when specified'+complete -c ugrep+ -s K -r -l range -l min-line -l max-line -d 'Start searching at line MIN, stop at line MAX when specified' complete -c ugrep+ -s k -l column-number -d 'The column number of a pattern match is displayed in front of the respective matched line, starting at column 1' complete -c ugrep+ -s L -l files-without-match -d 'Only the names of files not containing selected lines are written to standard output' complete -c ugrep+ -s l -l files-with-matches -d 'Only the names of files containing selected lines are written to standard output' complete -c ugrep+ -l label -d 'Displays the LABEL value when input is read from standard input where a file name would normally be printed in the output' complete -c ugrep+ -l line-buffered -d 'Force output to be line buffered instead of block buffered' complete -c ugrep+ -l lines -d 'Boolean line matching mode for option --bool, the default mode'-complete -c ugrep+ -s M -l file-magic -d 'Only search files matching the magic signature pattern MAGIC'-complete -c ugrep+ -s m -l min-count -l max-count -d 'Require MIN matches, stop after MAX matches when specified'+complete -c ugrep+ -s M -r -l file-magic -d 'Only search files matching the magic signature pattern MAGIC'+complete -c ugrep+ -s m -r -l min-count -l max-count -d 'Require MIN matches, stop after MAX matches when specified' complete -c ugrep+ -l match -d 'Match all input' complete -c ugrep+ -l max-files -d 'Restrict the number of files matched to NUM' complete -c ugrep+ -l mmap -d 'Use memory maps to search files'-complete -c ugrep+ -s N -l neg-regexp -d 'Specify a negative PATTERN to reject pattern matches that also match PATTERN'+complete -c ugrep+ -s N -r -l neg-regexp -d 'Specify a negative PATTERN to reject pattern matches that also match PATTERN' complete -c ugrep+ -s n -l line-number -d 'Each output line is preceded by its relative line number in the file, starting at line 1' complete -c ugrep+ -l no-group-separator -d 'Removes the group separator line from the output for context options -A, -B and -C' complete -c ugrep+ -l not -d 'Specifies that PATTERN should not match'-complete -c ugrep+ -s O -l file-extension -d 'Only search files whose filename extensions match the specified comma-separated list of EXTENSIONS, same as -g *.ext for each'+complete -c ugrep+ -s O -r -l file-extension -d 'Only search files whose filename extensions match the specified comma-separated list of EXTENSIONS, same as -g *.ext for each' complete -c ugrep+ -s o -l only-matching -d 'Only the matching part of a pattern match is output' complete -c ugrep+ -l only-line-number -d 'Only the line number of a matching line is output' complete -c ugrep+ -l files -o '%%' -d 'Boolean file matching mode, the opposite of --lines'
@@ -23,20 +23,20 @@ complete -c ugrep -l delay -d 'Set the default -Q key response delay' complete -c ugrep -l depth -s 1 -s 2 -s 3 -s 9 -o '10' -o '11' -d 'Restrict recursive searches from MIN to MAX directory levels deep, where -1 (--depth=1) searches the specified path without recursing into subdirectories' complete -c ugrep -l dotall -d 'Dot . in regular expressions matches anything, including newline.' complete -c ugrep -s E -l extended-regexp -d 'Interpret patterns as extended regular expressions (EREs)'-complete -c ugrep -s e -l regexp -d 'Specify a PATTERN to search the input'+complete -c ugrep -s e -r -l regexp -d 'Specify a PATTERN to search the input' complete -c ugrep -l encoding -xa '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 ' -d 'The encoding format of the input' complete -c ugrep -l exclude -d 'Exclude files whose name matches GLOB, same as -g ^GLOB' complete -c ugrep -l exclude-dir -d 'Exclude directories whose name matches GLOB from recursive searches, same as -g ^GLOB/' complete -c ugrep -l exclude-from -d 'Read the globs from FILE and skip files and directories whose name matches one or more globs' complete -c ugrep -l exclude-fs -d 'Exclude file systems specified by MOUNTS from recursive searches' complete -c ugrep -s F -l fixed-strings -d 'Interpret pattern as a set of fixed strings, separated by newlines, any of which is to be matched'-complete -c ugrep -s f -l file -d 'Read newline-separated patterns from FILE'+complete -c ugrep -s f -r -l file -d 'Read newline-separated patterns from FILE' complete -c ugrep -l filter -d 'Filter files through the specified COMMANDS first before searching' complete -c ugrep -l filter-magic-label -d 'Associate LABEL with files whose signature "magic bytes" match the MAGIC regex pattern' complete -c ugrep -l format -d 'Output FORMAT-formatted matches' complete -c ugrep -l free-space -d 'Spacing (blanks and tabs) in regular expressions are ignored' complete -c ugrep -s G -l basic-regexp -d 'Interpret patterns as basic regular expressions (BREs)'-complete -c ugrep -s g -l glob -l iglob -d 'Only search files whose name matches the specified comma-separated list of GLOBS, same as --include=glob for each glob in GLOBS'+complete -c ugrep -s g -r -l glob -l iglob -d 'Only search files whose name matches the specified comma-separated list of GLOBS, same as --include=glob for each glob in GLOBS' complete -c ugrep -l glob-ignore-case -d 'Perform case-insensitive glob matching in general' complete -c ugrep -l group-separator -d 'Use SEP as a group separator for context options -A, -B and -C' complete -c ugrep -s H -l with-filename -d 'Always print the filename with output lines'@@ -54,26 +54,26 @@ complete -c ugrep -l include-dir -d 'Only directories whose name matches GLOB ar complete -c ugrep -l include-from -d 'Read the globs from FILE and search only files and directories whose name matches one or more globs' complete -c ugrep -l include-fs -d 'Only file systems specified by MOUNTS are included in recursive searches' complete -c ugrep -l index -d 'Perform index-based recursive search'-complete -c ugrep -s J -l jobs -d 'Specifies the number of threads spawned to search files'+complete -c ugrep -s J -r -l jobs -d 'Specifies the number of threads spawned to search files' complete -c ugrep -s j -l smart-case -d 'Perform case insensitive matching, unless a pattern is specified with a literal upper case ASCII letter' complete -c ugrep -l json -d 'Output file matches in JSON'-complete -c ugrep -s K -l range -l min-line -l max-line -d 'Start searching at line MIN, stop at line MAX when specified'+complete -c ugrep -s K -r -l range -l min-line -l max-line -d 'Start searching at line MIN, stop at line MAX when specified' complete -c ugrep -s k -l column-number -d 'The column number of a pattern match is displayed in front of the respective matched line, starting at column 1' complete -c ugrep -s L -l files-without-match -d 'Only the names of files not containing selected lines are written to standard output' complete -c ugrep -s l -l files-with-matches -d 'Only the names of files containing selected lines are written to standard output' complete -c ugrep -l label -d 'Displays the LABEL value when input is read from standard input where a file name would normally be printed in the output' complete -c ugrep -l line-buffered -d 'Force output to be line buffered instead of block buffered' complete -c ugrep -l lines -d 'Boolean line matching mode for option --bool, the default mode'-complete -c ugrep -s M -l file-magic -d 'Only search files matching the magic signature pattern MAGIC'-complete -c ugrep -s m -l min-count -l max-count -d 'Require MIN matches, stop after MAX matches when specified'+complete -c ugrep -s M -r -l file-magic -d 'Only search files matching the magic signature pattern MAGIC'+complete -c ugrep -s m -r -l min-count -l max-count -d 'Require MIN matches, stop after MAX matches when specified' complete -c ugrep -l match -d 'Match all input' complete -c ugrep -l max-files -d 'Restrict the number of files matched to NUM' complete -c ugrep -l mmap -d 'Use memory maps to search files'-complete -c ugrep -s N -l neg-regexp -d 'Specify a negative PATTERN to reject pattern matches that also match PATTERN'+complete -c ugrep -s N -r -l neg-regexp -d 'Specify a negative PATTERN to reject pattern matches that also match PATTERN' complete -c ugrep -s n -l line-number -d 'Each output line is preceded by its relative line number in the file, starting at line 1' complete -c ugrep -l no-group-separator -d 'Removes the group separator line from the output for context options -A, -B and -C' complete -c ugrep -l not -d 'Specifies that PATTERN should not match'-complete -c ugrep -s O -l file-extension -d 'Only search files whose filename extensions match the specified comma-separated list of EXTENSIONS, same as -g *.ext for each'+complete -c ugrep -s O -r -l file-extension -d 'Only search files whose filename extensions match the specified comma-separated list of EXTENSIONS, same as -g *.ext for each' complete -c ugrep -s o -l only-matching -d 'Only the matching part of a pattern match is output' complete -c ugrep -l only-line-number -d 'Only the line number of a matching line is output' complete -c ugrep -l files -o '%%' -d 'Boolean file matching mode, the opposite of --lines'
@@ -34,7 +34,7 @@ local arguments=( --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]'+{-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]'@@ -58,7 +58,7 @@ local arguments=( --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]' --index'[Perform index-based recursive search]'-{-J,--jobs=-}'[Specifies the number of threads spawned to search files]'+{-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]' --json'[Output file matches in JSON]' {-K,--range=-,--min-line=-,--max-line=-}'[Start searching at line MIN, stop at line MAX when specified]:MIN,MAX:( )'@@ -68,7 +68,7 @@ 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]'+{-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]'
@@ -34,7 +34,7 @@ local arguments=( --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]'+{-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]'@@ -58,7 +58,7 @@ local arguments=( --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]' --index'[Perform index-based recursive search]'-{-J,--jobs=-}'[Specifies the number of threads spawned to search files]'+{-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]' --json'[Output file matches in JSON]' {-K,--range=-,--min-line=-,--max-line=-}'[Start searching at line MIN, stop at line MAX when specified]:MIN,MAX:( )'@@ -68,7 +68,7 @@ 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]'+{-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]'
@@ -34,7 +34,7 @@ local arguments=( --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]'+{-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]'@@ -58,7 +58,7 @@ local arguments=( --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]' --index'[Perform index-based recursive search]'-{-J,--jobs=-}'[Specifies the number of threads spawned to search files]'+{-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]' --json'[Output file matches in JSON]' {-K,--range=-,--min-line=-,--max-line=-}'[Start searching at line MIN, stop at line MAX when specified]:MIN,MAX:( )'@@ -68,7 +68,7 @@ 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]'+{-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]'
@@ -34,7 +34,7 @@ local arguments=( --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]'+{-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]'@@ -58,7 +58,7 @@ local arguments=( --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]' --index'[Perform index-based recursive search]'-{-J,--jobs=-}'[Specifies the number of threads spawned to search files]'+{-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]' --json'[Output file matches in JSON]' {-K,--range=-,--min-line=-,--max-line=-}'[Start searching at line MIN, stop at line MAX when specified]:MIN,MAX:( )'@@ -68,7 +68,7 @@ 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]'+{-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]'
completions/zsh/compgen
@@ -27,7 +27,7 @@ export ENCODING=$($UGREP --encoding=list 2>&1 | sed -e 's/^.[a-z].*are//' -e '/h # enclose description in brackets '[description]:message:action # change --hexdump, --sort, -Z and --fuzzy to append - to take arguments # add ':message:action' to -DACTION and -dACTION-# add ':message:( )' to -e, -g, -K, -m, -N, -O,--file-extention+# add ':message:( )' to -e, -f, -g, -J, -K, -M, -m, -N, -O,--file-extention # add ':message:action' to -t,--file-type=TYPES and --encoding=ENCODING # add ':message:action' to --hexdump # add ':message:action' to --sort=KEY@@ -43,7 +43,7 @@ $UGREP --help 2>&1 \ | sed -E -e "s/ /'[/" -e "s/\.?$/\]/" \ | sed -E -e "s/--hexdump/--hexdump=-/" -e "s/--sort/--sort=-/" -e "s/-Z,--fuzzy/-Z-,--fuzzy=-/" \ | sed -E -e "/\{-D/s/$/:ACTION:(read skip)/" -e "/\{-d/s/$/:ACTION:(read recurse skip)/" \- | sed -E -e "/\{-g/s/$/:GLOB:( )/" -e "/\{-[eN]/s/$/:PATTERN:( )/" -e "/\{-[Km]/s/$/:MIN,MAX:( )/" -e "/\{-O/s/$/:EXT:( )/" \+ | sed -E -e "/\{-g/s/$/:GLOB:( )/" -e "/\{-[eMN]/s/$/:PATTERN:( )/" -e "/\{-f/s/$/:FILE:_files/" -e "/\{-J/s/$/:NUM:( )/" -e "/\{-[Km]/s/$/:MIN,MAX:( )/" -e "/\{-O/s/$/:EXT:( )/" \ | sed -E -e "/\{-t/s/$/:TYPES:($TYPES)/" -e "/--encoding/s/$/:ENCODING:($ENCODING)/" \ | sed -E -e "/--hexdump/s/$/:NUM:(1a 2a 4ah 6ah 8ah 1aC1 2aC1 4ahC1 6ahC1 8ahC1)/" \ | sed -E -e "/\{-m/s/$/::(1 1, 1,10)/" \
@@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles.-# Generated by GNU Autoconf 2.71 for ugrep 4.3.+# Generated by GNU Autoconf 2.71 for ugrep 4.4. # # # Copyright (C) 1992-1996, 1998-2017, 2020-2021 Free Software Foundation,@@ -610,8 +610,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='ugrep' PACKAGE_TARNAME='ugrep'-PACKAGE_VERSION='4.3'-PACKAGE_STRING='ugrep 4.3'+PACKAGE_VERSION='4.4'+PACKAGE_STRING='ugrep 4.4' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -1379,7 +1379,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF-\`configure' configures ugrep 4.3 to adapt to many kinds of systems.+\`configure' configures ugrep 4.4 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1450,7 +1450,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in- short | recursive ) echo "Configuration of ugrep 4.3:";;+ short | recursive ) echo "Configuration of ugrep 4.4:";; esac cat <<\_ACEOF @@ -1623,7 +1623,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF-ugrep configure 4.3+ugrep configure 4.4 generated by GNU Autoconf 2.71 Copyright (C) 2021 Free Software Foundation, Inc.@@ -2160,7 +2160,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by ugrep $as_me 4.3, which was+It was created by ugrep $as_me 4.4, which was generated by GNU Autoconf 2.71. Invocation command line was $ $0$ac_configure_args_raw@@ -3647,7 +3647,7 @@ fi # Define the identity of the package. PACKAGE='ugrep'- VERSION='4.3'+ VERSION='4.4' printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h@@ -10188,7 +10188,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log="-This file was extended by ugrep $as_me 4.3, which was+This file was extended by ugrep $as_me 4.4, which was generated by GNU Autoconf 2.71. Invocation command line was CONFIG_FILES = $CONFIG_FILES@@ -10256,7 +10256,7 @@ ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config='$ac_cs_config_escaped' ac_cs_version="\\-ugrep config.status 4.3+ugrep config.status 4.4 configured by $0, generated by GNU Autoconf 2.71, with options \\"\$ac_cs_config\\"
@@ -1,4 +1,4 @@-AC_INIT([ugrep],[4.3])+AC_INIT([ugrep],[4.4]) AM_INIT_AUTOMAKE([foreign]) AC_CONFIG_HEADERS([config.h]) AC_COPYRIGHT([Copyright (C) 2019-2023 Robert van Engelen, Genivia Inc.])
@@ -51,7 +51,7 @@ The default pattern syntax is an extended form of the POSIX ERE syntax, same as option \fB-E\fR (\fB--extended-regexp\fR). Try \fBug --help regex\fR for help with pattern syntax and how to use logical connectives to specify Boolean search queries with option \fB-%\fR (\fB--bool\fR) to match lines and \fB-%%\fR-(\fB--files --bool\fR) to match files. Options \fB-F\fR+(\fB--bool --files\fR) to match files. Options \fB-F\fR (\fB--fixed-strings\fR), \fB-G\fR (\fB--basic-regexp\fR) and \fB-P\fR (\fB--perl-regexp\fR) specify other pattern syntaxes. .PP
@@ -1,4 +1,4 @@-.TH UGREP "1" "December 07, 2023" "ugrep 4.3.6" "User Commands"+.TH UGREP "1" "December 18, 2023" "ugrep 4.4.0" "User Commands" .SH NAME \fBugrep\fR, \fBug\fR -- file pattern searcher .SH SYNOPSIS@@ -36,7 +36,7 @@ The default pattern syntax is an extended form of the POSIX ERE syntax, same as option \fB-E\fR (\fB--extended-regexp\fR). Try \fBug --help regex\fR for help with pattern syntax and how to use logical connectives to specify Boolean search queries with option \fB-%\fR (\fB--bool\fR) to match lines and \fB-%%\fR-(\fB--files --bool\fR) to match files. Options \fB-F\fR+(\fB--bool --files\fR) to match files. Options \fB-F\fR (\fB--fixed-strings\fR), \fB-G\fR (\fB--basic-regexp\fR) and \fB-P\fR (\fB--perl-regexp\fR) specify other pattern syntaxes. .PP@@ -137,11 +137,11 @@ the \fB\-\-binary\-files\fR=text option. This option might output binary garbage to the terminal, which can have problematic consequences if the terminal driver interprets some of it as commands. .TP-\fB\-\-and\fR [\fB\-e\fR] PATTERN ... \fB\-e\fR \fIPATTERN\fR-Specify additional patterns to match. Patterns must be specified-with \fB\-e\fR. Each \fB\-e\fR \fIPATTERN\fR following this option is considered an-alternative pattern to match, i.e. each \fB\-e\fR is interpreted as an OR-pattern. For example, \fB\-e\fR \fIA\fR \fB\-e\fR \fIB\fR \fB\-\-and\fR \fB\-e\fR \fIC\fR \fB\-e\fR \fID\fR matches lines with+\fB\-\-and\fR [\fB\-e\fR] PATTERN+Specify additional PATTERN that must match. Additional \fB\-e\fR \fIPATTERN\fR+following this option is considered an alternative pattern to+match, i.e. each \fB\-e\fR is interpreted as an OR pattern enclosed within+the AND. For example, \fB\-e\fR \fIA\fR \fB\-e\fR \fIB\fR \fB\-\-and\fR \fB\-e\fR \fIC\fR \fB\-e\fR \fID\fR matches lines with (`A' or `B') and (`C' or `D'). Note that multiple \fB\-e\fR \fIPATTERN\fR are alternations that bind more tightly together than \fB\-\-and\fR. Option \fB\-\-stats\fR displays the search patterns applied. See also options@@ -157,8 +157,8 @@ specified, output the match with context to fit NUM columns before the match or shortens the match. See also options \fB\-A\fR, \fB\-C\fR and \fB\-y\fR. .TP \fB\-b\fR, \fB\-\-byte\-offset\fR-The offset in bytes of a matched line is displayed in front of the-respective matched line. If \fB\-u\fR is specified, displays the offset+The offset in bytes of a pattern match is displayed in front of the+respective matched line. When \fB\-u\fR is specified, displays the offset for each pattern matched on the same line. Byte offsets are exact for ASCII, UTF\-8 and raw binary input. Otherwise, the byte offset in the UTF\-8 normalized input is displayed.@@ -195,7 +195,7 @@ query pattern are regular expressions, unless \fB\-F\fR is specified. Options \fB\-E\fR, \fB\-F\fR, \fB\-G\fR, \fB\-P\fR and \fB\-Z\fR can be combined with \fB\-\-bool\fR to match subpatterns as strings or regular expressions (\fB\-E\fR is the default.) This option does not apply to \fB\-f\fR \fIFILE\fR patterns. The double short-option \fB\-%\fR% enables options \fB\-\-files\fR \fB\-\-bool\fR. Option \fB\-\-stats\fR displays+option \fB\-%\fR% enables options \fB\-\-bool\fR \fB\-\-files\fR. Option \fB\-\-stats\fR displays the Boolean search patterns applied. See also options \fB\-\-and\fR, \fB\-\-andnot\fR, \fB\-\-not\fR, \fB\-\-files\fR and \fB\-\-lines\fR. .TP@@ -219,10 +219,10 @@ matching files without outputting zero matches. If \fB\-\-tree\fR is specified, outputs directories in a tree\-like format. .TP \fB\-\-color\fR[=\fIWHEN\fR], \fB\-\-colour\fR[=\fIWHEN\fR]-Mark up the matching text with the expression stored in the-GREP_COLOR or GREP_COLORS environment variable. WHEN can be-`never', `always', or `auto', where `auto' marks up matches only-when output on a terminal. The default is `auto'.+Mark up the matching text with the colors specified with option+\fB\-\-colors\fR or the GREP_COLOR or GREP_COLORS environment variable.+WHEN can be `never', `always', or `auto', where `auto' marks up+matches only when output on a terminal. The default is `auto'. .TP \fB\-\-colors\fR=\fICOLORS\fR, \fB\-\-colours\fR=\fICOLORS\fR Use COLORS to mark up text. COLORS is a colon\-separated list of@@ -278,7 +278,7 @@ equivalent to the \fB\-R\fR option. \fB\-\-delay\fR=\fIDELAY\fR Set the default \fB\-Q\fR key response delay. Default is 3 for 300ms. .TP-\fB\-\-depth\fR=[\fIMIN\fR,][\fIMAX\fR], \fB\-1\fR, \fB\-2\fR, \fB\-3\fR, ... \fB\-9\fR, \fB\-1\fR0, \fB\-1\fR1, \fB\-1\fR2, ...+\fB\-\-depth\fR=[\fIMIN\fR,][\fIMAX\fR], \fB\-1\fR, \fB\-2\fR, \fB\-3\fR, ... \fB\-9\fR, \fB\-1\fR0, \fB\-1\fR1, ... Restrict recursive searches from MIN to MAX directory levels deep, where \fB\-1\fR (\fB\-\-depth\fR=1) searches the specified path without recursing into subdirectories. The short forms \fB\-3\fR \fB\-5\fR, \fB\-3\fR\-5 and \fB\-3\fR,5 search 3@@ -293,12 +293,12 @@ Interpret patterns as extended regular expressions (EREs). This is the default. .TP \fB\-e\fR \fIPATTERN\fR, \fB\-\-regexp\fR=\fIPATTERN\fR-Specify a PATTERN used during the search of the input: an input-line is selected if it matches any of the specified patterns.-Note that longer patterns take precedence over shorter patterns.-This option is most useful when multiple \fB\-e\fR options are used to-specify multiple patterns, when a pattern begins with a dash (`\-'),-to specify a pattern after option \fB\-f\fR or after the FILE arguments.+Specify a PATTERN to search the input. An input line is selected+if it matches any of the specified patterns. Note that longer+patterns take precedence over shorter patterns. This option is+most useful when multiple \fB\-e\fR options are used to specify multiple+patterns, when a pattern begins with a dash (`\-'), to specify a+pattern after option \fB\-f\fR or after the FILE arguments. .TP \fB\-\-encoding\fR=\fIENCODING\fR The encoding format of the input. The default ENCODING is binary@@ -315,15 +315,14 @@ PATTERN matching (text matching is the default.) ENCODING can be: `KOI8\-RU'. .TP \fB\-\-exclude\fR=\fIGLOB\fR-Skip files whose name matches GLOB using wildcard matching, same as-\fB\-g\fR ^GLOB. GLOB can use **, *, ?, and [...] as wildcards and \\ to-quote a wildcard or backslash character literally. When GLOB-contains a `/', full pathnames are matched. Otherwise basenames-are matched. When GLOB ends with a `/', directories are excluded-as if \fB\-\-exclude\-dir\fR is specified. Otherwise files are excluded.-Note that \fB\-\-exclude\fR patterns take priority over \fB\-\-include\fR patterns.-GLOB should be quoted to prevent shell globbing. This option may-be repeated.+Exclude files whose name matches GLOB, same as \fB\-g\fR ^GLOB. GLOB can+use **, *, ?, and [...] as wildcards and \\ to quote a wildcard or+backslash character literally. When GLOB contains a `/', full+pathnames are matched. Otherwise basenames are matched. When GLOB+ends with a `/', directories are excluded as if \fB\-\-exclude\-dir\fR is+specified. Otherwise files are excluded. Note that \fB\-\-exclude\fR+patterns take priority over \fB\-\-include\fR patterns. GLOB should be+quoted to prevent shell globbing. This option may be repeated. .TP \fB\-\-exclude\-dir\fR=\fIGLOB\fR Exclude directories whose name matches GLOB from recursive@@ -347,10 +346,10 @@ starting with a `#' and empty lines in FILE are ignored. When FILE is a `\-', standard input is read. This option may be repeated. .TP \fB\-\-exclude\-fs\fR=\fIMOUNTS\fR-Exclude file systems specified by MOUNTS from recursive searches,-MOUNTS is a comma\-separated list of mount points or pathnames of-directories on file systems. Note that \fB\-\-exclude\-fs\fR mounts take-priority over \fB\-\-include\-fs\fR mounts. This option may be repeated.+Exclude file systems specified by MOUNTS from recursive searches.+MOUNTS is a comma\-separated list of mount points or pathnames to+directories. Note that \fB\-\-exclude\-fs\fR=\fIMOUNTS\fR take priority over+\fB\-\-include\-fs\fR=\fIMOUNTS\fR. This option may be repeated. .TP \fB\-F\fR, \fB\-\-fixed\-strings\fR Interpret pattern as a set of fixed strings, separated by newlines,@@ -402,12 +401,11 @@ is also enabled. Context options \fB\-A\fR, \fB\-B\fR, \fB\-C\fR and \fB\-y\fR Spacing (blanks and tabs) in regular expressions are ignored. .TP \fB\-G\fR, \fB\-\-basic\-regexp\fR-Interpret patterns as basic regular expressions (BREs), i.e. make-ugrep behave as traditional grep.+Interpret patterns as basic regular expressions (BREs). .TP \fB\-g\fR \fIGLOBS\fR, \fB\-\-glob\fR=\fIGLOBS\fR, \fB\-\-iglob\fR=\fIGLOBS\fR-Search only files whose name matches the specified comma\-separated-list of GLOBS, same as \fB\-\-include\fR='glob' for each `glob' in GLOBS.+Only search files whose name matches the specified comma\-separated+list of GLOBS, same as \fB\-\-include\fR=glob for each `glob' in GLOBS. When a `glob' is preceded by a `!' or a `^', skip files whose name matches `glob', same as \fB\-\-exclude\fR='glob'. When `glob' contains a `/', full pathnames are matched. Otherwise basenames are matched.@@ -486,15 +484,14 @@ arguments are never ignored. This option may be repeated to specify additional files. .TP \fB\-\-include\fR=\fIGLOB\fR-Search only files whose name matches GLOB using wildcard matching,-same as \fB\-g\fR \fIGLOB\fR. GLOB can use **, *, ?, and [...] as wildcards and-\\ to quote a wildcard or backslash character literally. When GLOB-contains a `/', full pathnames are matched. Otherwise basenames-are matched. When GLOB ends with a `/', directories are included-as if \fB\-\-include\-dir\fR is specified. Otherwise files are included.-Note that \fB\-\-exclude\fR patterns take priority over \fB\-\-include\fR patterns.-GLOB should be quoted to prevent shell globbing. This option may-be repeated.+Only search files whose name matches GLOB, same as \fB\-g\fR \fIGLOB\fR. GLOB+can use **, *, ?, and [...] as wildcards and \\ to quote a wildcard+or backslash character literally. When GLOB contains a `/', full+pathnames are matched. Otherwise basenames are matched. When GLOB+ends with a `/', directories are included as if \fB\-\-include\-dir\fR is+specified. Otherwise files are included. Note that \fB\-\-exclude\fR+patterns take priority over \fB\-\-include\fR patterns. GLOB should be+quoted to prevent shell globbing. This option may be repeated. .TP \fB\-\-include\-dir\fR=\fIGLOB\fR Only directories whose name matches GLOB are included in recursive@@ -521,10 +518,10 @@ may be repeated. \fB\-\-include\-fs\fR=\fIMOUNTS\fR Only file systems specified by MOUNTS are included in recursive searches. MOUNTS is a comma\-separated list of mount points or-pathnames of directories on file systems. \fB\-\-include\-fs\fR=. restricts-recursive searches to the file system of the working directory-only. Note that \fB\-\-exclude\-fs\fR mounts take priority over-\fB\-\-include\-fs\fR mounts. This option may be repeated.+pathnames to directories. \fB\-\-include\-fs\fR=. restricts recursive+searches to the file system of the working directory only. Note+that \fB\-\-exclude\-fs\fR=\fIMOUNTS\fR take priority over \fB\-\-include\-fs\fR=\fIMOUNTS\fR.+This option may be repeated. .TP \fB\-\-index\fR Perform index\-based recursive search. This option assumes, but@@ -546,8 +543,8 @@ simultaneously. \fB\-J\fR1 disables threading: files are searched in the same order as specified. .TP \fB\-j\fR, \fB\-\-smart\-case\fR-Perform case insensitive matching like option \fB\-i\fR, unless a pattern-is specified with a literal ASCII upper case letter.+Perform case insensitive matching, unless a pattern is specified+with a literal upper case ASCII letter. .TP \fB\-\-json\fR Output file matches in JSON. If \fB\-H\fR, \fB\-n\fR, \fB\-k\fR, or \fB\-b\fR is specified,@@ -557,9 +554,9 @@ additional values are output. See also options \fB\-\-format\fR and \fB\-u\fR. Start searching at line MIN, stop at line MAX when specified. .TP \fB\-k\fR, \fB\-\-column\-number\fR-The column number of a matched pattern is displayed in front of the+The column number of a pattern match is displayed in front of the respective matched line, starting at column 1. Tabs are expanded-when columns are counted, see also option \fB\-\-tabs\fR.+in counting columns, see also option \fB\-\-tabs\fR. .TP \fB\-L\fR, \fB\-\-files\-without\-match\fR Only the names of files not containing selected lines are written@@ -589,7 +586,7 @@ Force output to be line buffered instead of block buffered. Boolean line matching mode for option \fB\-\-bool\fR, the default mode. .TP \fB\-M\fR \fIMAGIC\fR, \fB\-\-file\-magic\fR=\fIMAGIC\fR-Only files matching the signature pattern MAGIC are searched. The+Only search files matching the magic signature pattern MAGIC. The signature "magic bytes" at the start of a file are compared to the MAGIC regex pattern. When matching, the file will be searched. When MAGIC is preceded by a `!' or a `^', skip files with matching@@ -617,13 +614,11 @@ under certain conditions to improve performance. When MAX is specified, use up to MAX mmap memory per thread. .TP \fB\-N\fR \fIPATTERN\fR, \fB\-\-neg\-regexp\fR=\fIPATTERN\fR-Specify a negative PATTERN used during the search of the input: an-input line is selected only if it matches the specified patterns-unless it matches the negative PATTERN. Same as \fB\-e\fR (?^PATTERN).-Negative pattern matches are essentially removed before any other-patterns are matched. Note that longer patterns take precedence-over shorter patterns. Option \fB\-N\fR cannot be specified with \fB\-P\fR.-This option may be repeated.+Specify a negative PATTERN to reject pattern matches that also+match PATTERN. Note that longer patterns take precedence over+shorter patterns, i.e. a negative pattern must be of the same+length or longer to reject matching patterns. Option \fB\-N\fR cannot be+specified with \fB\-P\fR. This option may be repeated. .TP \fB\-n\fR, \fB\-\-line\-number\fR Each output line is preceded by its relative line number in the@@ -642,31 +637,30 @@ displays the search patterns applied. See also options \fB\-\-and\fR, \fB\-\-andnot\fR, \fB\-\-bool\fR, \fB\-\-files\fR and \fB\-\-lines\fR. .TP \fB\-O\fR \fIEXTENSIONS\fR, \fB\-\-file\-extension\fR=\fIEXTENSIONS\fR-Search only files whose filename extensions match the specified-comma\-separated list of EXTENSIONS, same as \fB\-\-include\fR='*.ext' for-each `ext' in EXTENSIONS. When an `ext' is preceded by a `!' or a-`^', skip files whose filename extensions matches `ext', same as-\fB\-\-exclude\fR='*.ext'. This option may be repeated and may be combined-with options \fB\-g\fR, \fB\-M\fR and \fB\-t\fR to expand the recursive search.+Only search files whose filename extensions match the specified+comma\-separated list of EXTENSIONS, same as \fB\-g\fR '*.ext' for each+`ext' in EXTENSIONS. When an `ext' is preceded by a `!' or a `^',+skip files whose filename extensions matches `ext', same as+\fB\-g\fR '^*.ext'. This option may be repeated and may be combined with+options \fB\-g\fR, \fB\-M\fR and \fB\-t\fR to expand the recursive search. .TP \fB\-o\fR, \fB\-\-only\-matching\fR-Output only the matching part of lines. If \fB\-A\fR, \fB\-B\fR or \fB\-C\fR is-specified, fits the match and its context on a line within the-specified number of columns.+Only the matching part of a pattern match is output. If \fB\-A\fR, \fB\-B\fR or+\fB\-C\fR is specified, fits the match and its context on a line within+the specified number of columns. .TP \fB\-\-only\-line\-number\fR-The line number of the matching line in the file is output without-displaying the match. The line number counter is reset for each-file processed.+Only the line number of a matching line is output. The line number+counter is reset for each file processed. .TP \fB\-\-files\fR, \fB\-%\fR% Boolean file matching mode, the opposite of \fB\-\-lines\fR. When combined with option \fB\-\-bool\fR, matches a file if all Boolean conditions are-satisfied. For example, \fB\-\-files\fR \fB\-\-bool\fR 'A B|C \fB\-D\fR' matches a file+satisfied. For example, \fB\-\-bool\fR \fB\-\-files\fR 'A B|C \fB\-D\fR' matches a file if some lines match `A', and some lines match either `B' or `C', and no line matches `D'. See also options \fB\-\-and\fR, \fB\-\-andnot\fR, \fB\-\-not\fR, \fB\-\-bool\fR and \fB\-\-lines\fR. The double short option \fB\-%\fR% enables options-\fB\-\-files\fR \fB\-\-bool\fR.+\fB\-\-bool\fR \fB\-\-files\fR. .TP \fB\-P\fR, \fB\-\-perl\-regexp\fR Interpret PATTERN as a Perl regular expression using PCRE2.@@ -710,7 +704,7 @@ Quiet mode: suppress all output. Only search a file until a match has been found. .TP \fB\-R\fR, \fB\-\-dereference\-recursive\fR-Recursively read all files under each directory. Follow symbolic+Recursively read all files under each directory, following symbolic links to files and directories, unlike \fB\-r\fR. .TP \fB\-r\fR, \fB\-\-recursive\fR@@ -720,18 +714,18 @@ arguments are specified and input is read from a terminal, recursive searches are performed as if \fB\-r\fR is specified. .TP \fB\-\-replace\fR=\fIFORMAT\fR-Replace matching patterns in the output by the specified FORMAT-with `%' fields. If \fB\-P\fR is specified, FORMAT may include `%1' to-`%9', `%[\fINUM\fR]#' and `%[\fINAME\fR]#' to output group captures. A `%%'-outputs `%' and `%~' outputs a newline. See option \fB\-\-format\fR,-`ugrep \fB\-\-help\fR format' and `man ugrep' section FORMAT for details.+Replace matching patterns in the output by FORMAT with `%' fields.+If \fB\-P\fR is specified, FORMAT may include `%1' to `%9', `%[\fINUM\fR]#' and+`%[\fINAME\fR]#' to output group captures. A `%%' outputs `%' and `%~'+outputs a newline. See also option \fB\-\-format\fR, `ugrep \fB\-\-help\fR format'+and `man ugrep' section FORMAT for details. .TP \fB\-S\fR, \fB\-\-dereference\-files\fR When \fB\-r\fR is specified, follow symbolic links to files, but not to directories. The default is not to follow symbolic links. .TP \fB\-s\fR, \fB\-\-no\-messages\fR-Silent mode: nonexistent and unreadable files are ignored, i.e.+Silent mode: nonexistent and unreadable files are ignored and their error messages and warnings are suppressed. .TP \fB\-\-save\-config\fR[=\fIFILE\fR] [\fIOPTIONS\fR]@@ -880,7 +874,7 @@ not only lines containing the character `x'. Any line is output (passthru). Non\-matching lines are output as context with a `\-' separator. See also options \fB\-A\fR, \fB\-B\fR and \fB\-C\fR. .TP-\fB\-Z\fR[best][+\-~][\fIMAX\fR], \fB\-\-fuzzy\fR=[best][+\-~][\fIMAX\fR]+\fB\-Z\fR[best][+\-~][\fIMAX\fR], \fB\-\-fuzzy\fR[=[best][+\-~][\fIMAX\fR]] Fuzzy mode: report approximate pattern matches within MAX errors. The default is \fB\-Z\fR1: one deletion, insertion or substitution is allowed. If `+`, `\-' and/or `~' is specified, then `+' allows@@ -916,7 +910,7 @@ brotli (requires suffix .br). \fB\-\-zmax\fR=\fINUM\fR When used with option \fB\-z\fR (\fB\-\-decompress\fR), searches the contents of compressed files and archives stored within archives by up to NUM-expansion levels deep. The default \fB\-\-zmax\fR=1 only permits searching+expansion stages. The default \fB\-\-zmax\fR=1 only permits searching uncompressed files stored in cpio, pax, tar and zip archives; compressed files and archives are detected as binary files and are effectively ignored. Specify \fB\-\-zmax\fR=2 to search compressed files
@@ -254,90 +254,26 @@ void Query::display(int col, int len) ptr = next + 1; alert = false; }- else if (!Screen::mono && !flag_fixed_strings)+ else if (!Screen::mono) {- if (ch == '[' && !list && !literal && !braced)+ if (!flag_fixed_strings) {- list = true;- Screen::put(ptr, next - ptr);- Screen::normal();- Screen::put(color_qm);- Screen::put(ch);- Screen::normal();- Screen::put(color_ql);- ptr = ++next;- next += (*next == '^');- next += (*next == '\\');- }- else if (ch == ']' && list && !literal && !braced)- {- list = false;- Screen::put(ptr, next - ptr);- Screen::normal();- Screen::put(color_qm);- Screen::put(ch);- Screen::normal();- Screen::put(color_qr);- ptr = next + 1;- }- else if (ch == '{' && !list && !literal && !braced)- {- braced = true;- Screen::put(ptr, next - ptr);- Screen::normal();- Screen::put(color_qb);- ptr = next;- }- else if (ch == '}' && !list && !literal && braced)- {- braced = false;- Screen::put(ptr, next - ptr + 1);- Screen::normal();- Screen::put(color_qr);- ptr = next + 1;- }- else if (ch == '"' && !list && !braced && flag_bool)- {- literal = !literal;- Screen::put(ptr, next - ptr);- Screen::normal();- Screen::put(color_ql);- Screen::put(ch);- Screen::normal();- if (literal)- Screen::put(color_ql);- else- Screen::put(color_qr);- ptr = next + 1;- }- else if (ch == '\\' && next + 1 != err && next[1] >= ' ' && next[1] <= '~')- {- if (next[1] == 'E' && !list)- literal = false;- if (!literal)+ if (ch == '[' && !list && !literal && !braced) {- if (next[1] == 'Q' && !list)- literal = true;+ list = true; Screen::put(ptr, next - ptr); Screen::normal(); Screen::put(color_qm); Screen::put(ch);- if (next + 1 < end)- Screen::put(next[1]); Screen::normal();- if (literal || list)- Screen::put(color_ql);- else if (braced)- Screen::put(color_qb);- else- Screen::put(color_qr);- ptr = ++next + 1;+ Screen::put(color_ql);+ ptr = ++next;+ next += (*next == '^');+ next += (*next == '\\'); }- }- else if (strchr("$()*+.?^|", ch) != NULL && !list && !literal && !braced)- {- if (!flag_basic_regexp || strchr("()+?|", ch) == NULL)+ else if (ch == ']' && list && !literal && !braced) {+ list = false; Screen::put(ptr, next - ptr); Screen::normal(); Screen::put(color_qm);@@ -346,10 +282,77 @@ void Query::display(int col, int len) Screen::put(color_qr); ptr = next + 1; }+ else if (ch == '{' && !list && !literal && !braced)+ {+ braced = true;+ Screen::put(ptr, next - ptr);+ Screen::normal();+ Screen::put(color_qb);+ ptr = next;+ }+ else if (ch == '}' && !list && !literal && braced)+ {+ braced = false;+ Screen::put(ptr, next - ptr + 1);+ Screen::normal();+ Screen::put(color_qr);+ ptr = next + 1;+ }+ else if (ch == '\\' && next + 1 != err && next[1] >= ' ' && next[1] <= '~')+ {+ if (next[1] == 'E' && !list)+ literal = false;+ if (!literal)+ {+ if (next[1] == 'Q' && !list)+ literal = true;+ Screen::put(ptr, next - ptr);+ Screen::normal();+ Screen::put(color_qm);+ Screen::put(ch);+ if (next + 1 < end)+ Screen::put(next[1]);+ Screen::normal();+ if (literal || list)+ Screen::put(color_ql);+ else if (braced)+ Screen::put(color_qb);+ else+ Screen::put(color_qr);+ ptr = ++next + 1;+ }+ }+ else if (strchr("$()*+.?^|", ch) != NULL && !list && !literal && !braced)+ {+ if (!flag_basic_regexp || strchr("()+?|", ch) == NULL)+ {+ Screen::put(ptr, next - ptr);+ Screen::normal();+ Screen::put(color_qm);+ Screen::put(ch);+ Screen::normal();+ Screen::put(color_qr);+ ptr = next + 1;+ }+ } }- else if (flag_bool && !list && !literal && !braced)+ if (flag_bool && !list && !braced) {- if (prev == ' ')+ if (ch == '"')+ {+ literal = !literal;+ Screen::put(ptr, next - ptr);+ Screen::normal();+ Screen::put(color_ql);+ Screen::put(ch);+ Screen::normal();+ if (literal)+ Screen::put(color_ql);+ else+ Screen::put(color_qr);+ ptr = next + 1;+ }+ else if (!literal && prev == ' ') { if (ch == '-' || strncmp(next, "AND ", 4) == 0 ||@@ -3339,6 +3342,7 @@ void Query::meta(int key) flags_[15].flag = false; } break;+ case 'R': case 'r': for (int i = 33; i <= 41; ++i)@@ -3403,76 +3407,98 @@ void Query::meta(int key) msg.assign("\033[7mM- \033[m ").append(fp->text); msg[6] = fp->key; - if (key == '[')+ switch (key) {- if (!flags_[26].flag || flag_hexdump == NULL)- if (!flags_[0].flag && !flags_[1].flag)- flags_[3].flag = true;+ case '[':+ if (!flags_[26].flag || flag_hexdump == NULL)+ if (!flags_[0].flag && !flags_[1].flag)+ flags_[3].flag = true; - if (flags_[16].flag)- {- if (only_context_ > 1)- --only_context_;- msg.append(" to ").append(std::to_string(only_context_));- }- else- {- if (context_ > 1)- --context_;- msg.append(" to ").append(std::to_string(context_));- }- flags_[4].flag = false;- flags_[14].flag = false;- }- else if (key == ']')- {- if (flags_[26].flag && flag_hexdump != NULL)- {- ++context_;- msg.append(" to ").append(std::to_string(context_));- }- else if (flags_[16].flag)- {- if (flags_[0].flag || flags_[1].flag || flags_[3].flag)- ++only_context_;- else if (!flags_[0].flag && !flags_[1].flag)- flags_[3].flag = true;- msg.append(" to ").append(std::to_string(only_context_));- }- else- {- if (flags_[0].flag || flags_[1].flag || flags_[3].flag)- ++context_;- else if (!flags_[0].flag && !flags_[1].flag)- flags_[3].flag = true;- msg.append(" to ").append(std::to_string(context_));- }- flags_[4].flag = false;- flags_[14].flag = false;- }- else if (key == '{')- {- flags_[30].flag = true;+ if (flags_[16].flag)+ {+ if (only_context_ > 1)+ --only_context_;+ msg.append(" to ").append(std::to_string(only_context_));+ }+ else+ {+ if (context_ > 1)+ --context_;+ msg.append(" to ").append(std::to_string(context_));+ }+ flags_[4].flag = false;+ flags_[14].flag = false;+ break; - if ((fuzzy_ & 0xff) > 1)- fuzzy_ = ((fuzzy_ & 0xff) - 1) | (fuzzy_ & 0xff00);+ case ']':+ if (flags_[26].flag && flag_hexdump != NULL)+ {+ ++context_;+ msg.append(" to ").append(std::to_string(context_));+ }+ else if (flags_[16].flag)+ {+ if (flags_[0].flag || flags_[1].flag || flags_[3].flag)+ ++only_context_;+ else if (!flags_[0].flag && !flags_[1].flag)+ flags_[3].flag = true;+ msg.append(" to ").append(std::to_string(only_context_));+ }+ else+ {+ if (flags_[0].flag || flags_[1].flag || flags_[3].flag)+ ++context_;+ else if (!flags_[0].flag && !flags_[1].flag)+ flags_[3].flag = true;+ msg.append(" to ").append(std::to_string(context_));+ }+ flags_[4].flag = false;+ flags_[14].flag = false;+ break; - msg.append(" to ").append(std::to_string(fuzzy_ & 0xff));- }- else if (key == '}')- {- if (flags_[30].flag && (fuzzy_ & 0xff) < 0xff)- fuzzy_ = ((fuzzy_ & 0xff) + 1) | (fuzzy_ & 0xff00);- else+ case '{': flags_[30].flag = true; - msg.append(" to ").append(std::to_string(fuzzy_ & 0xff));- }- else- {- fp->flag = !fp->flag;+ if ((fuzzy_ & 0xff) > 1)+ fuzzy_ = ((fuzzy_ & 0xff) - 1) | (fuzzy_ & 0xff00);++ msg.append(" to ").append(std::to_string(fuzzy_ & 0xff));+ break;++ case '}':+ if (flags_[30].flag && (fuzzy_ & 0xff) < 0xff)+ fuzzy_ = ((fuzzy_ & 0xff) + 1) | (fuzzy_ & 0xff00);+ else+ flags_[30].flag = true;++ msg.append(" to ").append(std::to_string(fuzzy_ & 0xff));+ break; - msg.append(fp->flag ? " \033[32;1mon\033[m" : " \033[31;1moff\033[m");+ case '%':+ if (fp->flag)+ {+ if (!flag_files)+ {+ flag_files = true;+ msg.append(" \033[32;1mfiles\033[m");+ }+ else+ {+ fp->flag = false;+ flag_files = false;+ msg.append(" \033[31;1moff\033[m");+ }+ }+ else+ {+ fp->flag = true;+ msg.append(" \033[32;1mlines\033[m");+ }+ break;++ default:+ fp->flag = !fp->flag;+ msg.append(fp->flag ? " \033[32;1mon\033[m" : " \033[31;1moff\033[m"); } // search when in QUERY mode, otherwise refresh HELP display@@ -3890,6 +3916,9 @@ void Query::set_prompt() if (!flag_file.empty()) prompt_.append("file"); + if (flags_[42].flag)+ prompt_.append(flag_files ? "%%" : "bool");+ const char *mode; if (flags_[5].flag)@@ -3916,10 +3945,7 @@ void Query::set_prompt() mode = "Q>"; } - if (flags_[42].flag)- prompt_.append("bool").append(mode);- else- prompt_.append(mode);+ prompt_.append(mode); } }
@@ -424,6 +424,8 @@ void set_color(const char *colors, const char *parameter, char color[COLORLEN]); void trim(std::string& line); void trim_pathname_arg(const char *arg); bool is_output(ino_t inode);+const char *getoptarg(int argc, const char **argv, const char *arg, int& i);+const char *getloptarg(int argc, const char **argv, const char *arg, int& i); const char *strarg(const char *string); size_t strtonum(const char *string, const char *message); size_t strtopos(const char *string, const char *message);@@ -5109,22 +5111,22 @@ void options(std::list<std::pair<CNF::PATTERN,const char*>>& pattern_args, int a break; case 'a':- if (strncmp(arg, "after-context=", 14) == 0)- flag_after_context = strtonum(arg + 14, "invalid argument --after-context=");+ if (strcmp(arg, "after-context") == 0) // legacy form --after-context NUM+ flag_after_context = strtonum(getloptarg(argc, argv, "", i), "invalid argument --after-context=");+ else if (strncmp(arg, "after-context=", 14) == 0)+ flag_after_context = strtonum(getloptarg(argc, argv, arg + 14, i), "invalid argument --after-context="); else if (strcmp(arg, "and") == 0) option_and(pattern_args, i, argc, argv); else if (strncmp(arg, "and=", 4) == 0)- option_and(pattern_args, arg + 4);+ option_and(pattern_args, getloptarg(argc, argv, arg + 4, i)); else if (strcmp(arg, "andnot") == 0) option_andnot(pattern_args, i, argc, argv); else if (strncmp(arg, "andnot=", 7) == 0)- option_andnot(pattern_args, arg + 7);+ option_andnot(pattern_args, getloptarg(argc, argv, arg + 7, i)); else if (strcmp(arg, "any-line") == 0) flag_any_line = true; else if (strcmp(arg, "ascii") == 0) flag_binary = true;- else if (strcmp(arg, "after-context") == 0)- usage("missing argument for --", arg); else usage("invalid option --", arg, "--after-context=, --and, --andnot, --any-line or --ascii"); break;@@ -5132,22 +5134,24 @@ void options(std::list<std::pair<CNF::PATTERN,const char*>>& pattern_args, int a case 'b': if (strcmp(arg, "basic-regexp") == 0) flag_basic_regexp = true;+ else if (strcmp(arg, "before-context") == 0) // legacy form --before-context NUM+ flag_before_context = strtonum(getloptarg(argc, argv, "", i), "invalid argument --before-context="); else if (strncmp(arg, "before-context=", 15) == 0)- flag_before_context = strtonum(arg + 15, "invalid argument --before-context=");+ flag_before_context = strtonum(getloptarg(argc, argv, arg + 15, i), "invalid argument --before-context="); else if (strcmp(arg, "best-match") == 0) flag_best_match = true; else if (strcmp(arg, "binary") == 0) flag_binary = true;+ else if (strcmp(arg, "binary-files") == 0) // legacy form --binary-files TYPE+ flag_binary_files = strarg(getloptarg(argc, argv, "", i)); else if (strncmp(arg, "binary-files=", 13) == 0)- flag_binary_files = strarg(arg + 13);+ flag_binary_files = strarg(getloptarg(argc, argv, arg + 13, i)); else if (strcmp(arg, "bool") == 0) flag_bool = true; else if (strcmp(arg, "break") == 0) flag_break = true; else if (strcmp(arg, "byte-offset") == 0) flag_byte_offset = true;- else if (strcmp(arg, "before-context") == 0 || strcmp(arg, "binary-files") == 0)- usage("missing argument for --", arg); else usage("invalid option --", arg, "--basic-regexp, --before-context=, --binary, --binary-files=, --bool, --break or --byte-offset"); break;@@ -5156,30 +5160,30 @@ void options(std::list<std::pair<CNF::PATTERN,const char*>>& pattern_args, int a if (strcmp(arg, "color") == 0 || strcmp(arg, "colour") == 0) flag_color = Static::AUTO; else if (strncmp(arg, "color=", 6) == 0)- flag_color = strarg(arg + 6);+ flag_color = strarg(getloptarg(argc, argv, arg + 6, i)); else if (strncmp(arg, "colour=", 7) == 0)- flag_color = strarg(arg + 7);+ flag_color = strarg(getloptarg(argc, argv, arg + 7, i)); else if (strncmp(arg, "colors=", 7) == 0)- flag_colors = strarg(arg + 7);+ flag_colors = strarg(getloptarg(argc, argv, arg + 7, i)); else if (strncmp(arg, "colours=", 8) == 0)- flag_colors = strarg(arg + 8);+ flag_colors = strarg(getloptarg(argc, argv, arg + 8, i)); else if (strcmp(arg, "column-number") == 0) flag_column_number = true; else if (strcmp(arg, "config") == 0 || strncmp(arg, "config=", 7) == 0) ; // --config is pre-parsed before other options are parsed else if (strcmp(arg, "confirm") == 0) flag_confirm = true;+ else if (strcmp(arg, "context") == 0) // legacy form --context NUM+ flag_after_context = flag_before_context = strtonum(getloptarg(argc, argv, "", i), "invalid argument --context="); else if (strncmp(arg, "context=", 8) == 0)- flag_after_context = flag_before_context = strtonum(arg + 8, "invalid argument --context=");+ flag_after_context = flag_before_context = strtonum(getloptarg(argc, argv, arg + 8, i), "invalid argument --context="); else if (strcmp(arg, "count") == 0) flag_count = true; else if (strcmp(arg, "cpp") == 0) flag_cpp = true; else if (strcmp(arg, "csv") == 0) flag_csv = true;- else if (strcmp(arg, "colors") == 0 ||- strcmp(arg, "colours") == 0 ||- strcmp(arg, "context") == 0)+ else if (strcmp(arg, "colors") == 0 || strcmp(arg, "colours") == 0) usage("missing argument for --", arg); else usage("invalid option --", arg, "--color, --colors=, --column-number, --config, --confirm, --context=, --count, --cpp or --csv");@@ -5189,24 +5193,26 @@ void options(std::list<std::pair<CNF::PATTERN,const char*>>& pattern_args, int a if (strcmp(arg, "decompress") == 0) flag_decompress = true; else if (strncmp(arg, "delay=", 6) == 0)- flag_delay = strtonum(arg + 6, "invalid argument --delay=");+ flag_delay = strtonum(getloptarg(argc, argv, arg + 6, i), "invalid argument --delay="); else if (strncmp(arg, "depth=", 6) == 0)- set_depth_long(arg + 6);+ set_depth_long(getloptarg(argc, argv, arg + 6, i)); else if (strcmp(arg, "dereference") == 0) flag_dereference = true; else if (strcmp(arg, "dereference-files") == 0) flag_dereference_files = true; else if (strcmp(arg, "dereference-recursive") == 0) flag_directories = "dereference-recurse";+ else if (strcmp(arg, "devices") == 0) // legacy form --devices ACTION+ flag_devices = strarg(getloptarg(argc, argv, "", i)); else if (strncmp(arg, "devices=", 8) == 0)- flag_devices = strarg(arg + 8);+ flag_devices = strarg(getloptarg(argc, argv, arg + 8, i));+ else if (strcmp(arg, "directories") == 0) // legacy form --directories ACTION+ flag_directories = strarg(getloptarg(argc, argv, "", i)); else if (strncmp(arg, "directories=", 12) == 0)- flag_directories = strarg(arg + 12);+ flag_directories = strarg(getloptarg(argc, argv, arg + 12, i)); else if (strcmp(arg, "dotall") == 0) flag_dotall = true;- else if (strcmp(arg, "depth") == 0 ||- strcmp(arg, "devices") == 0 ||- strcmp(arg, "directories") == 0)+ else if (strcmp(arg, "delay") == 0 || strcmp(arg, "depth") == 0) usage("missing argument for --", arg); else usage("invalid option --", arg, "--decompress, --delay=, --depth=, --dereference, --dereference-files, --dereference-recursive, --devices=, --directories= or --dotall");@@ -5216,36 +5222,40 @@ void options(std::list<std::pair<CNF::PATTERN,const char*>>& pattern_args, int a if (strcmp(arg, "empty") == 0) flag_empty = true; else if (strncmp(arg, "encoding=", 9) == 0)- flag_encoding = strarg(arg + 9);+ flag_encoding = strarg(getloptarg(argc, argv, arg + 9, i));+ else if (strcmp(arg, "exclude") == 0) // legacy form --exclude GLOB+ flag_exclude.emplace_back(getloptarg(argc, argv, "", i)); else if (strncmp(arg, "exclude=", 8) == 0)- flag_exclude.emplace_back(arg + 8);+ flag_exclude.emplace_back(getloptarg(argc, argv, arg + 8, i));+ else if (strcmp(arg, "exclude-dir") == 0) // legacy form --exclude-dir GLOB+ flag_exclude_dir.emplace_back(getloptarg(argc, argv, "", i)); else if (strncmp(arg, "exclude-dir=", 12) == 0)- flag_exclude_dir.emplace_back(arg + 12);+ flag_exclude_dir.emplace_back(getloptarg(argc, argv, arg + 12, i));+ else if (strcmp(arg, "exclude-from") == 0) // legacy form --exclude-from FILE+ flag_exclude_from.emplace_back(getloptarg(argc, argv, "", i)); else if (strncmp(arg, "exclude-from=", 13) == 0)- flag_exclude_from.emplace_back(arg + 13);+ flag_exclude_from.emplace_back(getloptarg(argc, argv, arg + 13, i)); else if (strncmp(arg, "exclude-fs=", 11) == 0)- flag_exclude_fs.emplace_back(arg + 11);+ flag_exclude_fs.emplace_back(getloptarg(argc, argv, arg + 11, i)); else if (strcmp(arg, "extended-regexp") == 0) flag_basic_regexp = false;- else if (strcmp(arg, "encoding") == 0 ||- strcmp(arg, "exclude") == 0 ||- strcmp(arg, "exclude-dir") == 0 ||- strcmp(arg, "exclude-from") == 0 ||- strcmp(arg, "exclude-fs") == 0)+ else if (strcmp(arg, "encoding") == 0 || strcmp(arg, "exclude-fs") == 0) usage("missing argument for --", arg); else usage("invalid option --", arg, "--empty, --encoding=, --exclude=, --exclude-dir=, --exclude-from=, --exclude-fs= or --extended-regexp"); break; case 'f':- if (strncmp(arg, "file=", 5) == 0)- flag_file.emplace_back(arg + 5);+ if (strcmp(arg, "file") == 0) // legacy form --file FILE+ flag_file.emplace_back(getloptarg(argc, argv, "", i));+ else if (strncmp(arg, "file=", 5) == 0)+ flag_file.emplace_back(getloptarg(argc, argv, arg + 5, i)); else if (strncmp(arg, "file-extension=", 15) == 0)- flag_file_extension.emplace_back(arg + 15);+ flag_file_extension.emplace_back(getloptarg(argc, argv, arg + 15, i)); else if (strncmp(arg, "file-magic=", 11) == 0)- flag_file_magic.emplace_back(arg + 11);+ flag_file_magic.emplace_back(getloptarg(argc, argv, arg + 11, i)); else if (strncmp(arg, "file-type=", 10) == 0)- flag_file_type.emplace_back(arg + 10);+ flag_file_type.emplace_back(getloptarg(argc, argv, arg + 10, i)); else if (strcmp(arg, "files") == 0) flag_files = true; else if (strcmp(arg, "files-with-matches") == 0)@@ -5255,27 +5265,26 @@ void options(std::list<std::pair<CNF::PATTERN,const char*>>& pattern_args, int a else if (strcmp(arg, "fixed-strings") == 0) flag_fixed_strings = true; else if (strncmp(arg, "filter=", 7) == 0)- flag_filter.append(flag_filter.empty() ? "" : ",").append(arg + 7);+ flag_filter.append(flag_filter.empty() ? "" : ",").append(getloptarg(argc, argv, arg + 7, i)); else if (strncmp(arg, "filter-magic-label=", 19) == 0)- flag_filter_magic_label.emplace_back(arg + 19);+ flag_filter_magic_label.emplace_back(getloptarg(argc, argv, arg + 19, i)); else if (strncmp(arg, "format=", 7) == 0)- flag_format = strarg(arg + 7);+ flag_format = strarg(getloptarg(argc, argv, arg + 7, i)); else if (strncmp(arg, "format-begin=", 13) == 0)- flag_format_begin = strarg(arg + 13);+ flag_format_begin = strarg(getloptarg(argc, argv, arg + 13, i)); else if (strncmp(arg, "format-close=", 13) == 0)- flag_format_close = strarg(arg + 13);+ flag_format_close = strarg(getloptarg(argc, argv, arg + 13, i)); else if (strncmp(arg, "format-end=", 11) == 0)- flag_format_end = strarg(arg + 11);+ flag_format_end = strarg(getloptarg(argc, argv, arg + 11, i)); else if (strncmp(arg, "format-open=", 12) == 0)- flag_format_open = strarg(arg + 12);+ flag_format_open = strarg(getloptarg(argc, argv, arg + 12, i)); else if (strcmp(arg, "fuzzy") == 0) flag_fuzzy = 1; else if (strncmp(arg, "fuzzy=", 6) == 0)- flag_fuzzy = strtofuzzy(arg + 6, "invalid argument --fuzzy=");+ flag_fuzzy = strtofuzzy(getloptarg(argc, argv, arg + 6, i), "invalid argument --fuzzy="); else if (strcmp(arg, "free-space") == 0) flag_free_space = true;- else if (strcmp(arg, "file") == 0 ||- strcmp(arg, "file-extension") == 0 ||+ else if (strcmp(arg, "file-extension") == 0 || strcmp(arg, "file-magic") == 0 || strcmp(arg, "file-type") == 0 || strcmp(arg, "filter") == 0 ||@@ -5292,13 +5301,13 @@ void options(std::list<std::pair<CNF::PATTERN,const char*>>& pattern_args, int a case 'g': if (strncmp(arg, "glob=", 5) == 0)- flag_glob.emplace_back(arg + 5);+ flag_glob.emplace_back(getloptarg(argc, argv, arg + 5, i)); else if (strcmp(arg, "glob-ignore-case") == 0) flag_glob_ignore_case = true;- else if (strncmp(arg, "group-separator=", 16) == 0)- flag_group_separator = strarg(arg + 16); else if (strcmp(arg, "group-separator") == 0) flag_group_separator = "--";+ else if (strncmp(arg, "group-separator=", 16) == 0)+ flag_group_separator = strarg(getloptarg(argc, argv, arg + 16, i)); else if (strcmp(arg, "glob") == 0) usage("missing argument for --", arg); else@@ -5315,11 +5324,11 @@ void options(std::list<std::pair<CNF::PATTERN,const char*>>& pattern_args, int a else if (strcmp(arg, "hexdump") == 0) flag_hexdump = "2"; else if (strncmp(arg, "hexdump=", 8) == 0)- flag_hexdump = strarg(arg + 8);+ flag_hexdump = strarg(getloptarg(argc, argv, arg + 8, i)); else if (strcmp(arg, "hidden") == 0) flag_hidden = true; else if (strncmp(arg, "hyperlink=", 10) == 0)- flag_hyperlink = strarg(arg + 10);+ flag_hyperlink = strarg(getloptarg(argc, argv, arg + 10, i)); else if (strcmp(arg, "hyperlink") == 0) flag_hyperlink = ""; else@@ -5328,7 +5337,7 @@ void options(std::list<std::pair<CNF::PATTERN,const char*>>& pattern_args, int a case 'i': if (strncmp(arg, "iglob=", 6) == 0)- flag_iglob.emplace_back(arg + 6);+ flag_iglob.emplace_back(getloptarg(argc, argv, arg + 6, i)); else if (strcmp(arg, "ignore-binary") == 0) flag_binary_files = "without-match"; else if (strcmp(arg, "ignore-case") == 0)@@ -5336,27 +5345,30 @@ void options(std::list<std::pair<CNF::PATTERN,const char*>>& pattern_args, int a else if (strcmp(arg, "ignore-files") == 0) flag_ignore_files.insert(DEFAULT_IGNORE_FILE); else if (strncmp(arg, "ignore-files=", 13) == 0)- flag_ignore_files.insert(arg + 13);+ flag_ignore_files.insert(getloptarg(argc, argv, arg + 13, i));+ else if (strcmp(arg, "include") == 0) // legacy form --include GLOB+ flag_include.emplace_back(getloptarg(argc, argv, "", i)); else if (strncmp(arg, "include=", 8) == 0)- flag_include.emplace_back(arg + 8);+ flag_include.emplace_back(getloptarg(argc, argv, arg + 8, i));+ else if (strcmp(arg, "include-dir") == 0) // legacy form --include-dir GLOB+ flag_include_dir.emplace_back(getloptarg(argc, argv, "", i)); else if (strncmp(arg, "include-dir=", 12) == 0)- flag_include_dir.emplace_back(arg + 12);+ flag_include_dir.emplace_back(getloptarg(argc, argv, arg + 12, i));+ else if (strcmp(arg, "include-from") == 0) // legacy form --include-from FILE+ flag_include_from.emplace_back(getloptarg(argc, argv, "", i)); else if (strncmp(arg, "include-from=", 13) == 0)- flag_include_from.emplace_back(arg + 13);+ flag_include_from.emplace_back(getloptarg(argc, argv, arg + 13, i)); else if (strncmp(arg, "include-fs=", 11) == 0)- flag_include_fs.emplace_back(arg + 11);+ flag_include_fs.emplace_back(getloptarg(argc, argv, arg + 11, i)); else if (strcmp(arg, "index") == 0) flag_index = "safe"; else if (strncmp(arg, "index=", 6) == 0)- flag_index = strarg(arg + 6);+ flag_index = strarg(getloptarg(argc, argv, arg + 6, i)); else if (strcmp(arg, "initial-tab") == 0) flag_initial_tab = true; else if (strcmp(arg, "invert-match") == 0) flag_invert_match = true;- else if (strcmp(arg, "include") == 0 ||- strcmp(arg, "include-dir") == 0 ||- strcmp(arg, "include-from") == 0 ||- strcmp(arg, "include-fs") == 0)+ else if (strcmp(arg, "include-fs") == 0) usage("missing argument for --", arg); else usage("invalid option --", arg, "--ignore-case, --ignore-files, --include=, --include-dir=, --include-from=, --include-fs=, --initial-tab or --invert-match");@@ -5364,7 +5376,7 @@ void options(std::list<std::pair<CNF::PATTERN,const char*>>& pattern_args, int a case 'j': if (strncmp(arg, "jobs=", 5) == 0)- flag_jobs = strtonum(arg + 5, "invalid argument --jobs=");+ flag_jobs = strtonum(getloptarg(argc, argv, arg + 5, i), "invalid argument --jobs="); else if (strcmp(arg, "json") == 0) flag_json = true; else if (strcmp(arg, "jobs") == 0)@@ -5374,8 +5386,10 @@ void options(std::list<std::pair<CNF::PATTERN,const char*>>& pattern_args, int a break; case 'l':- if (strncmp(arg, "label=", 6) == 0)- flag_label = strarg(arg + 6);+ if (strcmp(arg, "label") == 0) // legacy form --label LABEL+ flag_label = strarg(getloptarg(argc, argv, "", i));+ else if (strncmp(arg, "label=", 6) == 0)+ flag_label = strarg(getloptarg(argc, argv, arg + 6, i)); else if (strcmp(arg, "line-buffered") == 0) flag_line_buffered = true; else if (strcmp(arg, "line-number") == 0)@@ -5384,8 +5398,6 @@ void options(std::list<std::pair<CNF::PATTERN,const char*>>& pattern_args, int a flag_line_regexp = true; else if (strcmp(arg, "lines") == 0) flag_files = false;- else if (strcmp(arg, "label") == 0)- usage("missing argument for --", arg); else usage("invalid option --", arg, "--label=, --line-buffered, --line-number, --line-regexp or --lines"); break;@@ -5394,27 +5406,27 @@ void options(std::list<std::pair<CNF::PATTERN,const char*>>& pattern_args, int a if (strcmp(arg, "match") == 0) flag_match = true; else if (strncmp(arg, "max-count=", 10) == 0)- flag_max_count = strtopos(arg + 10, "invalid argument --max-count=");+ flag_max_count = strtopos(getloptarg(argc, argv, arg + 10, i), "invalid argument --max-count="); else if (strncmp(arg, "max-depth=", 10) == 0)- flag_max_depth = strtopos(arg + 10, "invalid argument --max-depth=");+ flag_max_depth = strtopos(getloptarg(argc, argv, arg + 10, i), "invalid argument --max-depth="); else if (strncmp(arg, "max-files=", 10) == 0)- flag_max_files = strtopos(arg + 10, "invalid argument --max-files=");+ flag_max_files = strtopos(getloptarg(argc, argv, arg + 10, i), "invalid argument --max-files="); else if (strncmp(arg, "max-line=", 9) == 0)- flag_max_line = strtopos(arg + 9, "invalid argument --max-line=");+ flag_max_line = strtopos(getloptarg(argc, argv, arg + 9, i), "invalid argument --max-line="); else if (strncmp(arg, "max-queue=", 10) == 0)- flag_max_queue = strtopos(arg + 10, "invalid argument --max-queue=");+ flag_max_queue = strtopos(getloptarg(argc, argv, arg + 10, i), "invalid argument --max-queue="); else if (strncmp(arg, "min-count=", 10) == 0)- flag_min_count = strtopos(arg + 10, "invalid argument --min-count=");+ flag_min_count = strtopos(getloptarg(argc, argv, arg + 10, i), "invalid argument --min-count="); else if (strncmp(arg, "min-depth=", 10) == 0)- flag_min_depth = strtopos(arg + 10, "invalid argument --min-depth=");+ flag_min_depth = strtopos(getloptarg(argc, argv, arg + 10, i), "invalid argument --min-depth="); else if (strncmp(arg, "min-line=", 9) == 0)- flag_min_line = strtopos(arg + 9, "invalid argument --min-line=");+ flag_min_line = strtopos(getloptarg(argc, argv, arg + 9, i), "invalid argument --min-line="); else if (strncmp(arg, "min-steal=", 10) == 0)- flag_min_steal = strtopos(arg + 10, "invalid argument --min-steal=");+ flag_min_steal = strtopos(getloptarg(argc, argv, arg + 10, i), "invalid argument --min-steal="); else if (strcmp(arg, "mmap") == 0) flag_max_mmap = MAX_MMAP_SIZE; else if (strncmp(arg, "mmap=", 5) == 0)- flag_max_mmap = strtopos(arg + 5, "invalid argument --mmap=");+ flag_max_mmap = strtopos(getloptarg(argc, argv, arg + 5, i), "invalid argument --mmap="); else if (strcmp(arg, "messages") == 0) flag_no_messages = false; else if (strcmp(arg, "max-count") == 0 ||@@ -5431,11 +5443,11 @@ void options(std::list<std::pair<CNF::PATTERN,const char*>>& pattern_args, int a case 'n': if (strncmp(arg, "neg-regexp=", 11) == 0)- option_regexp(pattern_args, arg + 1, true);+ option_regexp(pattern_args, getloptarg(argc, argv, arg + 11, i), true); else if (strcmp(arg, "not") == 0) option_not(pattern_args, i, argc, argv); else if (strncmp(arg, "not=", 4) == 0)- option_not(pattern_args, arg + 4);+ option_not(pattern_args, getloptarg(argc, argv, arg + 4, i)); else if (strcmp(arg, "no-any-line") == 0) flag_any_line = false; else if (strcmp(arg, "no-ascii") == 0)@@ -5539,7 +5551,7 @@ void options(std::list<std::pair<CNF::PATTERN,const char*>>& pattern_args, int a if (strcmp(arg, "pager") == 0) flag_pager = ""; else if (strncmp(arg, "pager=", 6) == 0)- flag_pager = strarg(arg + 6);+ flag_pager = strarg(getloptarg(argc, argv, arg + 6, i)); else if (strcmp(arg, "passthru") == 0) flag_any_line = true; else if (strcmp(arg, "perl-regexp") == 0)@@ -5547,7 +5559,7 @@ void options(std::list<std::pair<CNF::PATTERN,const char*>>& pattern_args, int a else if (strcmp(arg, "pretty") == 0) flag_pretty = Static::AUTO; else if (strncmp(arg, "pretty=", 7) == 0)- flag_pretty = strarg(arg + 7);+ flag_pretty = strarg(getloptarg(argc, argv, arg + 7, i)); else usage("invalid option --", arg, "--pager, --passthru, --perl-regexp= or --pretty"); break;@@ -5556,7 +5568,7 @@ void options(std::list<std::pair<CNF::PATTERN,const char*>>& pattern_args, int a if (strcmp(arg, "query") == 0) flag_query = true; else if (strncmp(arg, "query=", 6) == 0)- flag_query = (flag_delay = strtonum(arg + 6, "invalid argument --query="), true);+ flag_query = (flag_delay = strtonum(getloptarg(argc, argv, arg + 6, i), "invalid argument --query="), true); else if (strcmp(arg, "quiet") == 0) flag_quiet = flag_no_messages = true; else@@ -5565,15 +5577,16 @@ void options(std::list<std::pair<CNF::PATTERN,const char*>>& pattern_args, int a case 'r': if (strncmp(arg, "range=", 6) == 0)- strtopos2(arg + 6, flag_min_line, flag_max_line, "invalid argument --range=");+ strtopos2(getloptarg(argc, argv, arg + 6, i), flag_min_line, flag_max_line, "invalid argument --range="); else if (strcmp(arg, "recursive") == 0) flag_directories = "recurse";+ else if (strcmp(arg, "regexp") == 0) // legacy form --regexp PATTERN+ option_regexp(pattern_args, getloptarg(argc, argv, "", i)); else if (strncmp(arg, "regexp=", 7) == 0)- option_regexp(pattern_args, arg + 7);+ option_regexp(pattern_args, getloptarg(argc, argv, arg + 7, i)); else if (strncmp(arg, "replace=", 8) == 0)- flag_replace = strarg(arg + 8);+ flag_replace = strarg(getloptarg(argc, argv, arg + 8, i)); else if (strcmp(arg, "range") == 0 ||- strcmp(arg, "regexp") == 0 || strcmp(arg, "replace") == 0) usage("missing argument for --", arg); else@@ -5584,11 +5597,11 @@ void options(std::list<std::pair<CNF::PATTERN,const char*>>& pattern_args, int a if (strcmp(arg, "save-config") == 0) flag_save_config = ".ugrep"; else if (strncmp(arg, "save-config=", 12) == 0)- flag_save_config = strarg(arg + 12);+ flag_save_config = strarg(getloptarg(argc, argv, arg + 12, i)); else if (strcmp(arg, "separator") == 0) flag_separator = NULL; else if (strncmp(arg, "separator=", 10) == 0)- flag_separator = strarg(arg + 10);+ flag_separator = strarg(getloptarg(argc, argv, arg + 10, i)); else if (strcmp(arg, "silent") == 0) flag_quiet = flag_no_messages = true; else if (strcmp(arg, "smart-case") == 0)@@ -5596,13 +5609,13 @@ void options(std::list<std::pair<CNF::PATTERN,const char*>>& pattern_args, int a else if (strcmp(arg, "sort") == 0) flag_sort = "name"; else if (strncmp(arg, "sort=", 5) == 0)- flag_sort = strarg(arg + 5);+ flag_sort = strarg(getloptarg(argc, argv, arg + 5, i)); else if (strcmp(arg, "split") == 0) flag_split = true; else if (strcmp(arg, "stats") == 0) flag_stats = ""; else if (strncmp(arg, "stats=", 6) == 0)- flag_stats = strarg(arg + 6);+ flag_stats = strarg(getloptarg(argc, argv, arg + 6, i)); else usage("invalid option --", arg, "--save-config, --separator, --silent, --smart-case, --sort, --split or --stats"); break;@@ -5611,11 +5624,11 @@ void options(std::list<std::pair<CNF::PATTERN,const char*>>& pattern_args, int a if (strcmp(arg, "tabs") == 0) flag_tabs = DEFAULT_TABS; else if (strncmp(arg, "tabs=", 5) == 0)- flag_tabs = strtopos(arg + 5, "invalid argument --tabs=");+ flag_tabs = strtopos(getloptarg(argc, argv, arg + 5, i), "invalid argument --tabs="); else if (strcmp(arg, "tag") == 0) flag_tag = DEFAULT_TAG; else if (strncmp(arg, "tag=", 4) == 0)- flag_tag = strarg(arg + 4);+ flag_tag = strarg(getloptarg(argc, argv, arg + 4, i)); else if (strcmp(arg, "text") == 0) flag_binary_files = "text"; else if (strcmp(arg, "tree") == 0)@@ -5635,7 +5648,7 @@ void options(std::list<std::pair<CNF::PATTERN,const char*>>& pattern_args, int a if (strcmp(arg, "version") == 0) version(); else if (strncmp(arg, "view=", 5) == 0)- flag_view = strarg(arg + 5);+ flag_view = strarg(getloptarg(argc, argv, arg + 5, i)); else if (strcmp(arg, "view") == 0) flag_view = ""; else@@ -5643,10 +5656,10 @@ void options(std::list<std::pair<CNF::PATTERN,const char*>>& pattern_args, int a break; case 'w':- if (strncmp(arg, "width=", 6) == 0)- flag_width = strtopos(arg + 6, "invalid argument --width=");- else if (strcmp(arg, "width") == 0)+ if (strcmp(arg, "width") == 0) flag_width = Screen::getsize();+ else if (strncmp(arg, "width=", 6) == 0)+ flag_width = strtopos(getloptarg(argc, argv, arg + 6, i), "invalid argument --width="); else if (strcmp(arg, "with-filename") == 0) flag_with_filename = true; else if (strcmp(arg, "with-hex") == 0)@@ -5666,7 +5679,7 @@ void options(std::list<std::pair<CNF::PATTERN,const char*>>& pattern_args, int a case 'z': if (strncmp(arg, "zmax=", 5) == 0)- flag_zmax = strtopos(arg + 5, "invalid argument --zmax=");+ flag_zmax = strtopos(getloptarg(argc, argv, arg + 5, i), "invalid argument --zmax="); else if (strcmp(arg, "zmax") == 0) usage("missing argument for --", arg); else@@ -5682,13 +5695,7 @@ void options(std::list<std::pair<CNF::PATTERN,const char*>>& pattern_args, int a break; case 'A':- ++arg;- if (*arg)- flag_after_context = strtonum(&arg[*arg == '='], "invalid argument -A=");- else if (++i < argc)- flag_after_context = strtonum(argv[i], "invalid argument -A=");- else- usage("missing NUM argument for option -A");+ flag_after_context = strtonum(getoptarg(argc, argv, arg, i), "invalid argument -A="); is_grouped = false; break; @@ -5697,13 +5704,7 @@ void options(std::list<std::pair<CNF::PATTERN,const char*>>& pattern_args, int a break; case 'B':- ++arg;- if (*arg)- flag_before_context = strtonum(&arg[*arg == '='], "invalid argument -B=");- else if (++i < argc)- flag_before_context = strtonum(argv[i], "invalid argument -B=");- else- usage("missing NUM argument for option -B");+ flag_before_context = strtonum(getoptarg(argc, argv, arg, i), "invalid argument -B="); is_grouped = false; break; @@ -5712,13 +5713,7 @@ void options(std::list<std::pair<CNF::PATTERN,const char*>>& pattern_args, int a break; case 'C':- ++arg;- if (*arg)- flag_after_context = flag_before_context = strtonum(&arg[*arg == '='], "invalid argument -C=");- else if (++i < argc)- flag_after_context = flag_before_context = strtonum(argv[i], "invalid argument -C=");- else- usage("missing NUM argument for option -C");+ flag_after_context = flag_before_context = strtonum(getoptarg(argc, argv, arg, i), "invalid argument -C="); is_grouped = false; break; @@ -5727,24 +5722,12 @@ void options(std::list<std::pair<CNF::PATTERN,const char*>>& pattern_args, int a break; case 'D':- ++arg;- if (*arg)- flag_devices = &arg[*arg == '='];- else if (++i < argc)- flag_devices = argv[i];- else- usage("missing ACTION argument for option -D");+ flag_devices = getoptarg(argc, argv, arg, i); is_grouped = false; break; case 'd':- ++arg;- if (*arg)- flag_directories = &arg[*arg == '='];- else if (++i < argc)- flag_directories = argv[i];- else- usage("missing ACTION argument for option -d");+ flag_directories = getoptarg(argc, argv, arg, i); is_grouped = false; break; @@ -5753,13 +5736,7 @@ void options(std::list<std::pair<CNF::PATTERN,const char*>>& pattern_args, int a break; case 'e':- ++arg;- if (*arg)- option_regexp(pattern_args, &arg[*arg == '=']);- else if (++i < argc)- option_regexp(pattern_args, argv[i]);- else- usage("missing PATTERN argument for option -e");+ option_regexp(pattern_args, getoptarg(argc, argv, arg, i)); is_grouped = false; break; @@ -5768,13 +5745,7 @@ void options(std::list<std::pair<CNF::PATTERN,const char*>>& pattern_args, int a break; case 'f':- ++arg;- if (*arg)- flag_file.emplace_back(&arg[*arg == '=']);- else if (++i < argc)- flag_file.emplace_back(argv[i]);- else- usage("missing FILE argument for option -f");+ flag_file.emplace_back(getoptarg(argc, argv, arg, i)); is_grouped = false; break; @@ -5783,13 +5754,7 @@ void options(std::list<std::pair<CNF::PATTERN,const char*>>& pattern_args, int a break; case 'g':- ++arg;- if (*arg)- flag_glob.emplace_back(&arg[*arg == '=']);- else if (++i < argc)- flag_glob.emplace_back(argv[i]);- else- usage("missing GLOB argument for option -g");+ flag_glob.emplace_back(getoptarg(argc, argv, arg, i)); is_grouped = false; break; @@ -5810,13 +5775,7 @@ void options(std::list<std::pair<CNF::PATTERN,const char*>>& pattern_args, int a break; case 'J':- ++arg;- if (*arg)- flag_jobs = strtonum(&arg[*arg == '='], "invalid argument -J=");- else if (++i < argc)- flag_jobs = strtonum(argv[i], "invalid argument -J=");- else- usage("missing NUM argument for option -J");+ flag_jobs = strtonum(getoptarg(argc, argv, arg, i), "invalid argument -J="); is_grouped = false; break; @@ -5825,13 +5784,7 @@ void options(std::list<std::pair<CNF::PATTERN,const char*>>& pattern_args, int a break; case 'K':- ++arg;- if (*arg)- strtopos2(&arg[*arg == '='], flag_min_line, flag_max_line, "invalid argument -K=");- else if (++i < argc)- strtopos2(argv[i], flag_min_line, flag_max_line, "invalid argument -K=");- else- usage("missing NUM argument for option -K");+ strtopos2(getoptarg(argc, argv, arg, i), flag_min_line, flag_max_line, "invalid argument -K="); is_grouped = false; break; @@ -5848,35 +5801,17 @@ void options(std::list<std::pair<CNF::PATTERN,const char*>>& pattern_args, int a break; case 'M':- ++arg;- if (*arg)- flag_file_magic.emplace_back(&arg[*arg == '=']);- else if (++i < argc)- flag_file_magic.emplace_back(argv[i]);- else- usage("missing MAGIC argument for option -M");+ flag_file_magic.emplace_back(getoptarg(argc, argv, arg, i)); is_grouped = false; break; case 'm':- ++arg;- if (*arg)- strtopos2(&arg[*arg == '='], flag_min_count, flag_max_count, "invalid argument -m=");- else if (++i < argc)- strtopos2(argv[i], flag_min_count, flag_max_count, "invalid argument -m=");- else- usage("missing MAX argument for option -m");+ strtopos2(getoptarg(argc, argv, arg, i), flag_min_count, flag_max_count, "invalid argument -m="); is_grouped = false; break; case 'N':- ++arg;- if (*arg)- option_regexp(pattern_args, &arg[*arg == '='], true);- else if (++i < argc)- option_regexp(pattern_args, argv[i], true);- else- usage("missing PATTERN argument for option -N");+ option_regexp(pattern_args, getoptarg(argc, argv, arg, i), true); is_grouped = false; break; @@ -5885,13 +5820,7 @@ void options(std::list<std::pair<CNF::PATTERN,const char*>>& pattern_args, int a break; case 'O':- ++arg;- if (*arg)- flag_file_extension.emplace_back(&arg[*arg == '=']);- else if (++i < argc)- flag_file_extension.emplace_back(argv[i]);- else- usage("missing EXTENSIONS argument for option -O");+ flag_file_extension.emplace_back(getoptarg(argc, argv, arg, i)); is_grouped = false; break; @@ -5946,13 +5875,7 @@ void options(std::list<std::pair<CNF::PATTERN,const char*>>& pattern_args, int a break; case 't':- ++arg;- if (*arg)- flag_file_type.emplace_back(&arg[*arg == '=']);- else if (++i < argc)- flag_file_type.emplace_back(argv[i]);- else- usage("missing TYPES argument for option -t");+ flag_file_type.emplace_back(getoptarg(argc, argv, arg, i)); is_grouped = false; break; @@ -6428,6 +6351,15 @@ void init(int argc, const char **argv) { int i, j; + if (strcmp(flag_encoding, "list") == 0)+ {+ // list the encoding_table[]+ for (i = 0; encoding_table[i].format != NULL; ++i)+ std::cerr << encoding_table[i].format << '\n';++ exit(EXIT_ERROR);+ }+ // scan the encoding_table[] for a matching encoding, case insensitive ASCII for (i = 0; encoding_table[i].format != NULL; ++i) {@@ -6972,6 +6904,29 @@ void init(int argc, const char **argv) if (type == type_table[i].type) break; + // if not found then find an unambiguous type with the specified filename suffix + if (type_table[i].type == NULL)+ {+ size_t k = i;+ for (size_t j = 0; type_table[j].type != NULL; ++j)+ {+ if (islower(type_table[j].type[0]))+ {+ const char *s = strstr(type_table[j].extensions, type.c_str());+ if (s != NULL && (s == type_table[j].extensions || *--s == ','))+ {+ if (type_table[k].type != NULL)+ {+ k = i;+ break;+ }+ k = j;+ }+ }+ }+ i = k;+ }+ if (type_table[i].type == NULL) { std::string msg("invalid argument -t TYPES, valid arguments are");@@ -7439,6 +7394,7 @@ void terminal() } } +// --hyperlink parsing void set_terminal_hyperlink() { // set prefix, host, current working directory path to output hyperlinks with --hyperlink@@ -13370,6 +13326,28 @@ void set_color(const char *colors, const char *parameter, char color[COLORLEN]) } } +// get short option argument+const char *getoptarg(int argc, const char **argv, const char *arg, int& i)+{+ if (*++arg == '=')+ ++arg;+ if (*arg != '\0')+ return arg;+ if (++i < argc)+ return argv[i];+ return "";+}++// get long option argument after =+const char *getloptarg(int argc, const char **argv, const char *arg, int& i)+{+ if (*arg != '\0')+ return arg;+ if (++i < argc)+ return argv[i];+ return "";+}+ // save a string argument parsed from the command line or from a config file const char *strarg(const char *string) {@@ -13399,6 +13377,11 @@ size_t strtopos(const char *string, const char *message) // convert one or two comma-separated unsigned decimals specifying a range to positive size_t, produce error when conversion fails or when the range is invalid void strtopos2(const char *string, size_t& min, size_t& max, const char *message) {+ if (*string == '\0')+ {+ usage(message, string);+ return;+ } char *rest = const_cast<char*>(string); if (*string != ',') min = static_cast<size_t>(strtoull(string, &rest, 10));@@ -13513,11 +13496,11 @@ void help(std::ostream& out) the --binary-files=text option. This option might output binary\n\ garbage to the terminal, which can have problematic consequences if\n\ the terminal driver interprets some of it as commands.\n\- --and [-e] PATTERN ... -e PATTERN\n\- Specify additional patterns to match. Patterns must be specified\n\- with -e. Each -e PATTERN following this option is considered an\n\- alternative pattern to match, i.e. each -e is interpreted as an OR\n\- pattern. For example, -e A -e B --and -e C -e D matches lines with\n\+ --and [-e] PATTERN\n\+ Specify additional PATTERN that must match. Additional -e PATTERN\n\+ following this option is considered an alternative pattern to\n\+ match, i.e. each -e is interpreted as an OR pattern enclosed within\n\+ the AND. For example, -e A -e B --and -e C -e D matches lines with\n\ (`A' or `B') and (`C' or `D'). Note that multiple -e PATTERN are\n\ alternations that bind more tightly together than --and. Option\n\ --stats displays the search patterns applied. See also options\n\@@ -13530,8 +13513,8 @@ void help(std::ostream& out) specified, output the match with context to fit NUM columns before\n\ the match or shortens the match. See also options -A, -C and -y.\n\ -b, --byte-offset\n\- The offset in bytes of a matched line is displayed in front of the\n\- respective matched line. If -u is specified, displays the offset\n\+ The offset in bytes of a pattern match is displayed in front of the\n\+ respective matched line. When -u is specified, displays the offset\n\ for each pattern matched on the same line. Byte offsets are exact\n\ for ASCII, UTF-8 and raw binary input. Otherwise, the byte offset\n\ in the UTF-8 normalized input is displayed.\n\@@ -13566,7 +13549,7 @@ void help(std::ostream& out) Options -E, -F, -G, -P and -Z can be combined with --bool to match\n\ subpatterns as strings or regular expressions (-E is the default.)\n\ This option does not apply to -f FILE patterns. The double short\n\- option -%% enables options --files --bool. Option --stats displays\n\+ option -%% enables options --bool --files. Option --stats displays\n\ the Boolean search patterns applied. See also options --and,\n\ --andnot, --not, --files and --lines.\n\ --break\n\@@ -13586,10 +13569,10 @@ void help(std::ostream& out) matching files without outputting zero matches. If --tree is\n\ specified, outputs directories in a tree-like format.\n\ --color[=WHEN], --colour[=WHEN]\n\- Mark up the matching text with the expression stored in the\n\- GREP_COLOR or GREP_COLORS environment variable. WHEN can be\n\- `never', `always', or `auto', where `auto' marks up matches only\n\- when output on a terminal. The default is `auto'.\n\+ Mark up the matching text with the colors specified with option\n\+ --colors or the GREP_COLOR or GREP_COLORS environment variable.\n\+ WHEN can be `never', `always', or `auto', where `auto' marks up\n\+ matches only when output on a terminal. The default is `auto'.\n\ --colors=COLORS, --colours=COLORS\n\ Use COLORS to mark up text. COLORS is a colon-separated list of\n\ one or more parameters `sl=' (selected line), `cx=' (context line),\n\@@ -13636,7 +13619,7 @@ void help(std::ostream& out) equivalent to the -R option.\n\ --delay=DELAY\n\ Set the default -Q key response delay. Default is 3 for 300ms.\n\- --depth=[MIN,][MAX], -1, -2, -3, ... -9, -10, -11, -12, ...\n\+ --depth=[MIN,][MAX], -1, -2, -3, ... -9, -10, -11, ...\n\ Restrict recursive searches from MIN to MAX directory levels deep,\n\ where -1 (--depth=1) searches the specified path without recursing\n\ into subdirectories. The short forms -3 -5, -3-5 and -3,5 search 3\n\@@ -13648,12 +13631,12 @@ void help(std::ostream& out) Interpret patterns as extended regular expressions (EREs). This is\n\ the default.\n\ -e PATTERN, --regexp=PATTERN\n\- Specify a PATTERN used during the search of the input: an input\n\- line is selected if it matches any of the specified patterns.\n\- Note that longer patterns take precedence over shorter patterns.\n\- This option is most useful when multiple -e options are used to\n\- specify multiple patterns, when a pattern begins with a dash (`-'),\n\- to specify a pattern after option -f or after the FILE arguments.\n\+ Specify a PATTERN to search the input. An input line is selected\n\+ if it matches any of the specified patterns. Note that longer\n\+ patterns take precedence over shorter patterns. This option is\n\+ most useful when multiple -e options are used to specify multiple\n\+ patterns, when a pattern begins with a dash (`-'), to specify a\n\+ pattern after option -f or after the FILE arguments.\n\ --encoding=ENCODING\n\ The encoding format of the input. The default ENCODING is binary\n\ and UTF-8 which are the same. Note that option -U specifies binary\n\@@ -13674,15 +13657,14 @@ void help(std::ostream& out) } out << ".\n\ --exclude=GLOB\n\- Skip files whose name matches GLOB using wildcard matching, same as\n\- -g ^GLOB. GLOB can use **, *, ?, and [...] as wildcards and \\ to\n\- quote a wildcard or backslash character literally. When GLOB\n\- contains a `/', full pathnames are matched. Otherwise basenames\n\- are matched. When GLOB ends with a `/', directories are excluded\n\- as if --exclude-dir is specified. Otherwise files are excluded.\n\- Note that --exclude patterns take priority over --include patterns.\n\- GLOB should be quoted to prevent shell globbing. This option may\n\- be repeated.\n\+ Exclude files whose name matches GLOB, same as -g ^GLOB. GLOB can\n\+ use **, *, ?, and [...] as wildcards and \\ to quote a wildcard or\n\+ backslash character literally. When GLOB contains a `/', full\n\+ pathnames are matched. Otherwise basenames are matched. When GLOB\n\+ ends with a `/', directories are excluded as if --exclude-dir is\n\+ specified. Otherwise files are excluded. Note that --exclude\n\+ patterns take priority over --include patterns. GLOB should be\n\+ quoted to prevent shell globbing. This option may be repeated.\n\ --exclude-dir=GLOB\n\ Exclude directories whose name matches GLOB from recursive\n\ searches, same as -g ^GLOB/. GLOB can use **, *, ?, and [...] as\n\@@ -13703,10 +13685,10 @@ void help(std::ostream& out) starting with a `#' and empty lines in FILE are ignored. When FILE\n\ is a `-', standard input is read. This option may be repeated.\n\ --exclude-fs=MOUNTS\n\- Exclude file systems specified by MOUNTS from recursive searches,\n\- MOUNTS is a comma-separated list of mount points or pathnames of\n\- directories on file systems. Note that --exclude-fs mounts take\n\- priority over --include-fs mounts. This option may be repeated.\n"+ Exclude file systems specified by MOUNTS from recursive searches.\n\+ MOUNTS is a comma-separated list of mount points or pathnames to\n\+ directories. Note that --exclude-fs=MOUNTS take priority over\n\+ --include-fs=MOUNTS. This option may be repeated.\n" #ifndef HAVE_STATVFS "\ This option is not available in this build configuration of ugrep.\n"@@ -13764,11 +13746,10 @@ void help(std::ostream& out) --free-space\n\ Spacing (blanks and tabs) in regular expressions are ignored.\n\ -G, --basic-regexp\n\- Interpret patterns as basic regular expressions (BREs), i.e. make\n\- ugrep behave as traditional grep.\n\+ Interpret patterns as basic regular expressions (BREs).\n\ -g GLOBS, --glob=GLOBS, --iglob=GLOBS\n\- Search only files whose name matches the specified comma-separated\n\- list of GLOBS, same as --include='glob' for each `glob' in GLOBS.\n\+ Only search files whose name matches the specified comma-separated\n\+ list of GLOBS, same as --include=glob for each `glob' in GLOBS.\n\ When a `glob' is preceded by a `!' or a `^', skip files whose name\n\ matches `glob', same as --exclude='glob'. When `glob' contains a\n\ `/', full pathnames are matched. Otherwise basenames are matched.\n\@@ -13838,15 +13819,14 @@ void help(std::ostream& out) arguments are never ignored. This option may be repeated to\n\ specify additional files.\n\ --include=GLOB\n\- Search only files whose name matches GLOB using wildcard matching,\n\- same as -g GLOB. GLOB can use **, *, ?, and [...] as wildcards and\n\- \\ to quote a wildcard or backslash character literally. When GLOB\n\- contains a `/', full pathnames are matched. Otherwise basenames\n\- are matched. When GLOB ends with a `/', directories are included\n\- as if --include-dir is specified. Otherwise files are included.\n\- Note that --exclude patterns take priority over --include patterns.\n\- GLOB should be quoted to prevent shell globbing. This option may\n\- be repeated.\n\+ Only search files whose name matches GLOB, same as -g GLOB. GLOB\n\+ can use **, *, ?, and [...] as wildcards and \\ to quote a wildcard\n\+ or backslash character literally. When GLOB contains a `/', full\n\+ pathnames are matched. Otherwise basenames are matched. When GLOB\n\+ ends with a `/', directories are included as if --include-dir is\n\+ specified. Otherwise files are included. Note that --exclude\n\+ patterns take priority over --include patterns. GLOB should be\n\+ quoted to prevent shell globbing. This option may be repeated.\n\ --include-dir=GLOB\n\ Only directories whose name matches GLOB are included in recursive\n\ searches, same as -g GLOB/. GLOB can use **, *, ?, and [...] as\n\@@ -13870,10 +13850,10 @@ void help(std::ostream& out) --include-fs=MOUNTS\n\ Only file systems specified by MOUNTS are included in recursive\n\ searches. MOUNTS is a comma-separated list of mount points or\n\- pathnames of directories on file systems. --include-fs=. restricts\n\- recursive searches to the file system of the working directory\n\- only. Note that --exclude-fs mounts take priority over\n\- --include-fs mounts. This option may be repeated.\n"+ pathnames to directories. --include-fs=. restricts recursive\n\+ searches to the file system of the working directory only. Note\n\+ that --exclude-fs=MOUNTS take priority over --include-fs=MOUNTS.\n\+ This option may be repeated.\n" #ifndef HAVE_STATVFS "\ This option is not available in this build configuration of ugrep.\n"@@ -13897,17 +13877,17 @@ void help(std::ostream& out) simultaneously. -J1 disables threading: files are searched in the\n\ same order as specified.\n\ -j, --smart-case\n\- Perform case insensitive matching like option -i, unless a pattern\n\- is specified with a literal ASCII upper case letter.\n\+ Perform case insensitive matching, unless a pattern is specified\n\+ with a literal upper case ASCII letter.\n\ --json\n\ Output file matches in JSON. If -H, -n, -k, or -b is specified,\n\ additional values are output. See also options --format and -u.\n\ -K [MIN,][MAX], --range=[MIN,][MAX], --min-line=MIN, --max-line=MAX\n\ Start searching at line MIN, stop at line MAX when specified.\n\ -k, --column-number\n\- The column number of a matched pattern is displayed in front of the\n\+ The column number of a pattern match is displayed in front of the\n\ respective matched line, starting at column 1. Tabs are expanded\n\- when columns are counted, see also option --tabs.\n\+ in counting columns, see also option --tabs.\n\ -L, --files-without-match\n\ Only the names of files not containing selected lines are written\n\ to standard output. Pathnames are listed once per file searched.\n\@@ -13931,7 +13911,7 @@ void help(std::ostream& out) --lines\n\ Boolean line matching mode for option --bool, the default mode.\n\ -M MAGIC, --file-magic=MAGIC\n\- Only files matching the signature pattern MAGIC are searched. The\n\+ Only search files matching the magic signature pattern MAGIC. The\n\ signature \"magic bytes\" at the start of a file are compared to\n\ the MAGIC regex pattern. When matching, the file will be searched.\n\ When MAGIC is preceded by a `!' or a `^', skip files with matching\n\@@ -13954,13 +13934,11 @@ void help(std::ostream& out) under certain conditions to improve performance. When MAX is\n\ specified, use up to MAX mmap memory per thread.\n\ -N PATTERN, --neg-regexp=PATTERN\n\- Specify a negative PATTERN used during the search of the input: an\n\- input line is selected only if it matches the specified patterns\n\- unless it matches the negative PATTERN. Same as -e (?^PATTERN).\n\- Negative pattern matches are essentially removed before any other\n\- patterns are matched. Note that longer patterns take precedence\n\- over shorter patterns. Option -N cannot be specified with -P.\n\- This option may be repeated.\n\+ Specify a negative PATTERN to reject pattern matches that also\n\+ match PATTERN. Note that longer patterns take precedence over\n\+ shorter patterns, i.e. a negative pattern must be of the same\n\+ length or longer to reject matching patterns. Option -N cannot be\n\+ specified with -P. This option may be repeated.\n\ -n, --line-number\n\ Each output line is preceded by its relative line number in the\n\ file, starting at line 1. The line number counter is reset for\n\@@ -13975,28 +13953,27 @@ void help(std::ostream& out) displays the search patterns applied. See also options --and,\n\ --andnot, --bool, --files and --lines.\n\ -O EXTENSIONS, --file-extension=EXTENSIONS\n\- Search only files whose filename extensions match the specified\n\- comma-separated list of EXTENSIONS, same as --include='*.ext' for\n\- each `ext' in EXTENSIONS. When an `ext' is preceded by a `!' or a\n\- `^', skip files whose filename extensions matches `ext', same as\n\- --exclude='*.ext'. This option may be repeated and may be combined\n\- with options -g, -M and -t to expand the recursive search.\n\+ Only search files whose filename extensions match the specified\n\+ comma-separated list of EXTENSIONS, same as -g '*.ext' for each\n\+ `ext' in EXTENSIONS. When an `ext' is preceded by a `!' or a `^',\n\+ skip files whose filename extensions matches `ext', same as\n\+ -g '^*.ext'. This option may be repeated and may be combined with\n\+ options -g, -M and -t to expand the recursive search.\n\ -o, --only-matching\n\- Output only the matching part of lines. If -A, -B or -C is\n\- specified, fits the match and its context on a line within the\n\- specified number of columns.\n\+ Only the matching part of a pattern match is output. If -A, -B or\n\+ -C is specified, fits the match and its context on a line within\n\+ the specified number of columns.\n\ --only-line-number\n\- The line number of the matching line in the file is output without\n\- displaying the match. The line number counter is reset for each\n\- file processed.\n\+ Only the line number of a matching line is output. The line number\n\+ counter is reset for each file processed.\n\ --files, -%%\n\ Boolean file matching mode, the opposite of --lines. When combined\n\ with option --bool, matches a file if all Boolean conditions are\n\- satisfied. For example, --files --bool 'A B|C -D' matches a file\n\+ satisfied. For example, --bool --files 'A B|C -D' matches a file\n\ if some lines match `A', and some lines match either `B' or `C',\n\ and no line matches `D'. See also options --and, --andnot, --not,\n\ --bool and --lines. The double short option -%% enables options\n\- --files --bool.\n\+ --bool --files.\n\ -P, --perl-regexp\n\ Interpret PATTERN as a Perl regular expression" #if defined(HAVE_PCRE2)@@ -14042,7 +14019,7 @@ void help(std::ostream& out) Quiet mode: suppress all output. Only search a file until a match\n\ has been found.\n\ -R, --dereference-recursive\n\- Recursively read all files under each directory. Follow symbolic\n\+ Recursively read all files under each directory, following symbolic\n\ links to files and directories, unlike -r.\n\ -r, --recursive\n\ Recursively read all files under each directory, following symbolic\n\@@ -14050,16 +14027,16 @@ void help(std::ostream& out) arguments are specified and input is read from a terminal,\n\ recursive searches are performed as if -r is specified.\n\ --replace=FORMAT\n\- Replace matching patterns in the output by the specified FORMAT\n\- with `%' fields. If -P is specified, FORMAT may include `%1' to\n\- `%9', `%[NUM]#' and `%[NAME]#' to output group captures. A `%%'\n\- outputs `%' and `%~' outputs a newline. See option --format,\n\- `ugrep --help format' and `man ugrep' section FORMAT for details.\n\+ Replace matching patterns in the output by FORMAT with `%' fields.\n\+ If -P is specified, FORMAT may include `%1' to `%9', `%[NUM]#' and\n\+ `%[NAME]#' to output group captures. A `%%' outputs `%' and `%~'\n\+ outputs a newline. See also option --format, `ugrep --help format'\n\+ and `man ugrep' section FORMAT for details.\n\ -S, --dereference-files\n\ When -r is specified, follow symbolic links to files, but not to\n\ directories. The default is not to follow symbolic links.\n\ -s, --no-messages\n\- Silent mode: nonexistent and unreadable files are ignored, i.e.\n\+ Silent mode: nonexistent and unreadable files are ignored and\n\ their error messages and warnings are suppressed.\n\ --save-config[=FILE] [OPTIONS]\n\ Save configuration FILE to include OPTIONS. Update FILE when\n\@@ -14172,7 +14149,7 @@ void help(std::ostream& out) -y, --any-line, --passthru\n\ Any line is output (passthru). Non-matching lines are output as\n\ context with a `-' separator. See also options -A, -B and -C.\n\- -Z[best][+-~][MAX], --fuzzy=[best][+-~][MAX]\n\+ -Z[best][+-~][MAX], --fuzzy[=[best][+-~][MAX]]\n\ Fuzzy mode: report approximate pattern matches within MAX errors.\n\ The default is -Z1: one deletion, insertion or substitution is\n\ allowed. If `+`, `-' and/or `~' is specified, then `+' allows\n\@@ -14233,7 +14210,7 @@ void help(std::ostream& out) --zmax=NUM\n\ When used with option -z (--decompress), searches the contents of\n\ compressed files and archives stored within archives by up to NUM\n\- expansion levels deep. The default --zmax=1 only permits searching\n\+ expansion stages. The default --zmax=1 only permits searching\n\ uncompressed files stored in cpio, pax, tar and zip archives;\n\ compressed files and archives are detected as binary files and are\n\ effectively ignored. Specify --zmax=2 to search compressed files\n\@@ -14307,7 +14284,7 @@ void help(const char *what) if (((what[j] ^ str.at(i + j)) & ~0x20) != 0) break; - if (what[j] == '\0')+ if (what[j] == '\0' || what[j] == '=' || isspace(what[j])) { if (pass == 0 ? i < nl: i > nl) {@@ -14467,7 +14444,7 @@ matches `x y' three times and a `z', since the outer parentheses group the AND\n (a space).\n\ \n\ The default is to match lines satisfying the Boolean query. To match files,\n\-specify the double short option -%% to enable both options --files --bool.\n\+specify the double short option -%% to enable both options --bool --files.\n\ \n\ See also options --and, --andnot, --not to specify sub-patterns as command-line\n\ arguments with options as logical operators.\n\
@@ -38,7 +38,7 @@ #define UGREP_HPP // ugrep version-#define UGREP_VERSION "4.3.6"+#define UGREP_VERSION "4.4.0" // disable mmap because mmap is almost always slower than the file reading speed improvements since 3.0.0 #define WITH_NO_MMAP
@@ -79,7 +79,12 @@ for OPS in '' '-F' '-G' '-P' ; do cat lorem | $UG $OPS -iwco --encoding=LATIN1 -f - lorem.latin1.txt > "out/lorem.latin1$OPS-iwco.out" done -$UG -Zio Lorem lorem.utf8.txt > out/lorem_Lorem-Zio.out+for PAT in '' 'Lorem' 'nomatch' ; do+ FN=`echo "lorem_$PAT" | tr -Cd '[:alnum:]_'`+ for OPS in '-Zio' '-ioZbest1' ; do+ $UG $OPS "$PAT" lorem.utf8.txt > out/$FN$OPS.out+ done+done $UG -ci hello $FILES > out/Hello_Hello-ci.out $UG -cj hello $FILES > out/Hello_Hello-cj.out
@@ -0,0 +1,33 @@+Lorêm ïpsûm dolor sit amét, noster përpètua id eum. An éùm grâêçi fëùgîat, dêlicàta cotidièqùè éx mèl. Usû ea solèt théophràstus, îûs ne aeternô êquidêm, vim èx âgam abhorreant incorrùpte. Ipsum sâlutatus iràcundîà àd èam. Dictas lobortîs accusamus ut eùm. [m+Solum eloqùéntiam cum at, ad aùtém tollît déserûnt sit. Alienùm albuciùs nominavi eu sit. Casé viris régione qui ut, éx cùm munére gubergren. Ad iudico aliénûm çùm. [m+Molestie intêrpretaris has éa, pro bonorum facîlîsîs disputândo éx, ëâ qûodsi îudîcabit mel. No dolôrèm scrïptorém dùo, ut çum vitae hâbèmus èlectrâm. No eum utïnam detràxit adolésçens, usu éi sale fierént nomïnati. Usù nô elîgendi conclûsionêmque. Pro eïus justô laudêm ea. [m+Cum animal tinçidunt ex, vix inànï popùlô nolùîsse eâ. Error àssûèvérit të vel, vitaê petentîum et nam. Mel eï dictàs latînë, nulla everti mandamus ut est. Atomôrùm rècteqûê ïus ëî, lùdus évêrtitur mëî ut, elïtr prômpta lêgimus êum ïd. Qui cû talé lêgimùs, êlit fêrrï lobortîs cùm ân. [m+Zril possît èléçtram nê sea. Ne êum accusàm dignîssim, fêugàît impërdïèt ratïonibùs eam né, graëço effïciàntùr ân nêc. Iùs quàlîsqué suscipiantur ne. Ea vis velit làtiné nûmquam. Ei nam pondêrum vérterem. At tâmquàm comprehensâm sèd, minïmum officîis expetêndis has cu. [m+An errem vèniâm pëtentium usu, unùm intêgré no sèa. Séd ad totâ ullum, vim ut nullàm vidîsse ômittantûr. At qùo iùdïcabït consectètuêr. Ludus feugiât éam cu, pèr êx èrrêm obliqué, ét saêpe consul comprèhênsam sêa. [m+Postëa façïlisi accommodarè has in. Et usu vûlputatë théôphrastùs. Stèt quôt singûlis nec ïn, id pêr mènandrï consequùntûr. Pro id inani fâbellas. Prï té utamur învênïre, eî sèd inanî mèdiocrêm, êt pôssim impetus épicurî qùo. [m+Mél èx mnésarçhum consètëtur, hîs dicant praesent qûalisqùe tê, dêbitîs perseçûti ei vél. Dïceret repudîàndae ét mea, his id nâtùm fabëllàs àssentïor. Est ad praesènt qûalisque. Sùas brùtë pèrtïnacia nô pér, at vim màgna zrïl desèrûissê. Për voçent fïérènt singulïs èt, at fastïdii postulant sêd. [m+Qûem modô pri çû, ad ïus numqûam dolores sûàvitaté, êa vim sônèt partem possim. Sëâ qûém vitae similiqûê cù. Et mei nûllâ érrém discérè, éà dolor utroqué scriptorèm eàm. Lâudém sîgniferumquè cu est, êx nôstro audïam accommodârè hïs. Nëc ad èvérti aliqûando. [m+Sed ad veri reprimique hônestatîs, èa sed vérïtùs admodum. Mâzim ômnésqùè mediocritatem eù ëum, ad vix qûëm vîvéndo ïnvènïré, ex nêç laborês antiopàm. Eam éx dêbét susçipït. Qùô optîon appareât ëx, mêl primà latiné êû. [m+Ea eum fûgit facilisi volutpat. At purto sèntentiae sît, porro tâtïon habemûs meï êt, tè vïm pôstéâ pértïnacia. Eos aùtém hàrum ei. Vïs të çetero timeam reprimiqûe, latiné admodum ôportéât méi ad. [m+Et prô suàs qûando voluptàtum, possît feûgait id vis. Nô îllûd novùm dëlectus vix. Ei altera tâmquam séd, séa no èîrmod torqûatos. Cum ut justo oporterê réctèque, ïn çum érant sîmul ponderum, vis quôt ridëns êi. [m+Nostrûm contentiones te vis, mûtat facilis sènsêrît pri în, ne est ïudîcô postéâ expêténdis. Vêlît vidîsse instructior his ân. Id vïm âpërïri alïquam intérèssêt, sit ëa légendos persécûti constïtuàm, eu sùmo dïspùtàtionî meâ. Postèa tritàni delëctùs at hïs, pri vivêndùm pérçipïtùr âd, êxerci scrïpta his ne. An utamùr ôblïquè perpetuà mèa. [m+Graeco forénsibûs has eû, ea appétëré sëntêntîâé sit, dîctà pûtant ïnteréssèt éum cû. Quèm errém çonsêctètûêr prî ïn. Pôrro solét qûando ést ét, diçàm labîtùr epicurei pro ea. At nëç voluptua recusabo pëtêntïùm, ut sëd feûgait pèrséquérîs. Te érïpuit dissentiet per, tè virïs cètèro pérsïus quô, essê aèqûe luptatum cù pro. [m+Ad mucius postéa dûo, éi consul lùptàtùm vîx. Eam maiôrum volûptua conclusionemque ad, est âd âlbucius lobortis. At pri primis medîocrèm. Vîs êx odio blandit. Fàstidii vôluptarîa înteressêt àt néc, ad pro quôt qûàs. [m+Nèc id modo erat, ut per labore véreàr sùavitate, pro êx iisquë intèresset. Duo ullùm lâbôrê praësënt ïd. Eu sèa solûm mâzim vocibus, salê çlïtà doctùs duô îd, vïm dolorem prôpriàe sâpïëntêm ët. Facilis vîvéndô té sèà, meï ut latïne âdîpïsci. [m+Quôt môlèstie laboràmus sit êi. In sed assûm vïvëndo âdversàriûm, àn vis rëqué âccusamus. Eâm graecî iisqué scripsèrît êu, ëa quo hâbeô postulànt. Vim possè graèco elàbôrârét cu. [m+In suas sint dèlïcata çùm. Pèrfèçto suscipïântûr în vim, sêa îpsum necéssitatibus ét. Quas aùgùë dêniquê per ïn. Lorèm nïhil abhorrèant ât mea, sit an omnîùm offîcïis, ëst âccùsam legendos intêrêssët çu. [m+Id nêç discèrê hendrêrït, làbore placërat înimicus în mel. Virtùte princîpes vim éû. Nâm àn ërîpûit postulànt hêndrérit. Qui êt argumêntum rëformidans, sùâvïtatè corrùmpit modëratius no vîs, an éam habêmûs mînîmùm. Ad consulatu dispûtationî has. [m+Eà diçta nonumy inîmîcus méa, cum te nibh lôrem labôre. Quôd éxerci ïùs àd, audiàm opôrteat éi vîx. No nêç dicàt nùmquàm ïnvidûnt. Mel facetë repùdiarè ut. Ea séd muciùs facëté, utamùr cônstitûam in pér. [m+Usu suscipit antiopam né, est librîs semper ùllamcôrper té. Ad mèl phâëdrum acçûsatà, his no option vulputate, èi magna solum deseruisse eum. Prï duïs deserunt vôluptatïbus eû. Sït ât debet offéndit copiosaé, diçèrèt constitùam vis èt. Adoléscéns pêrçipitûr id sèà. [m+At ômniùm fabùlas dissèntiàs prï, nonumès deseruîssé duo èâ. Ea mêâ viris ïgnotà, duo cù tantàs nominàti ocurrèrêt. Vel nusquam placerat ëî, no nâm prîmà prompta suscipït. Erat homero mea ét. [m+Cûm blândit petentium ût. Stèt demoçrîtum nè vîm, velït rîdens în sèd, vix an minim légëndos. Salê petentiûm sçrîptorém ut mêl. Exërci accusam an vïm, méî fèrri librïs ànimal àn, sëd în dïam commùne tacimates. [m+Consul périculâ qùo id, illud dolorem vel éx. Ad cum singûlis cotîdieqûé, talé diçtas doçtus cu eos. Et sît ùbiqué àlïquip percipitur, vim ômnesque assùêverît ad, ést éù discerê mandàmùs. Eù putant fabellas cum, dèlenïtî invîdûnt contentîones duo in. [m+Eos in nostrô faceté accusâmus, vîx essent tâmquam ad, duo în alterâ tritàni assûeverit. Pèr ei dètràxit phaêdrûm. Pèr ân wisi vocënt çôntentîonês, quï jùsto çhoro platonem nè. Eos ét esse sensibus éxplicâri, usu élît cèteros et. [m+Eum propriàé expêtenda în. Sit impedit ïmperdiêt ullâmcorpér tê, nostro commûné vulputâtê mei ét, nostèr sçàevolâ cum êù. Sit voçibus probatus cômplêctîtur cu, vel îd âdmodùm inimiçus, sit ad ùtînàm sâlûtatus rèfèrrêntùr. Lâbôré noluisse intéresset usu ea, èï àrgùmentum vitupèratorîbus mel. Ex sît novum rêgîoné, ïllud phaedrùm vim id. Id lorêm aliênum âccusàta sit. [m+Ut pùtant dolorés eleifend vïs, ét nibh luptàtûm posidoniûm îûs, his dèbitis dêlicata neglegêntur îd. Duo casè oràtio ëûîsmod id, sëa in wïsï volumus inîmiçûs. Dômîng putent recteque quo at. Etîam sëmper ornàtûs ét èam. Eû tôllït molèstié vêrtèrêm cum. [m+Quem èquidêm molestiaè ex nêc. Enim sôleat laborë méi at. Nëc dico fâbûlàs sçaëvola ex, vim éi vïtàë detracto vulpùtatè. Unum lûptatum élaborâret vèl ex, sît éu dîam lîbrîs mùcïus. Cum noster tîbïquè îd, at séd mutat âncîllae. Séà éx prïmis constitùto, vix tê èsse përcîpit vitùperata, mea suâvîtate dîspùtàndo no. [m+Id qui adhûc possït, làborê vïdissè përsecuti ïus no. Iuvarèt invênîre convénîre té méï, fàcete ancillaè oportere duô ad. Quot hômérô dôçtùs ad vèl. Ut eàm illud lègere, vulputaté ullamcorper mêa et. Qùot èpîçurï âncillae àd duô. Cù qui nusqûam sapïëntèm sàlutândï, âdhùc légendos at pri, an fùîssét pertïnax vel. Ut néc soléat vûlpûtàte, îd verïtùs mândamus perseqùeris qûî, èst sôlét phàèdrum in. [m+Usû ei dénîque vertèrêm delîcata, àn nàm quàs vïvèndum àbhorrèànt, çu homêrô consùlàtù usû. Cum lorêm dêçôre aliqûid tê, êst ut facète appellàntur. Nô natum ullum appetère nam, ex veniâm âperiri consétètur vix. Ad qûî prima rëbum placerat, nec sénsïbus laborâmus at. Pro màgna bonôrum évèrtitur nê, per àt reçusabo salùtatùs. Ut nam soluta postulant corrumpit, minîmùm recûsâbô posidoniûm ëst ât. [m+Ad iûs dicêrèt fâbûlâs conclùdatûrque. Pro ex copiosaé tïncïdunt, nâm tollït simïlique çonséqùuntur îd. Tôta phîlôsophia èt vél. No est errém feùgïat, vix impètus întèrprëtaris no. Tractatos dêfînïtionèm qui ëi, quot tollït ëst ad. [m+Nêc sançtus epicuri àccùsata et. Debitis persëcutï no qùi, feùgait patriôquë in çum, putànt vivëndum phaédrûm àn pri. Id eôs suas qùot, omniùm luptatum întèllégat mei tê. Omnés virtute copiosaè ne sêd. [m+Sed ad veri. [m
@@ -0,0 +1,33 @@+Lorêm ïpsûm dolor sit amét, noster përpètua id eum. An éùm grâêçi fëùgîat, dêlicàta cotidièqùè éx mèl. Usû ea solèt théophràstus, îûs ne aeternô êquidêm, vim èx âgam abhorreant incorrùpte. Ipsum sâlutatus iràcundîà àd èam. Dictas lobortîs accusamus ut eùm. [m+Solum eloqùéntiam cum at, ad aùtém tollît déserûnt sit. Alienùm albuciùs nominavi eu sit. Casé viris régione qui ut, éx cùm munére gubergren. Ad iudico aliénûm çùm. [m+Molestie intêrpretaris has éa, pro bonorum facîlîsîs disputândo éx, ëâ qûodsi îudîcabit mel. No dolôrèm scrïptorém dùo, ut çum vitae hâbèmus èlectrâm. No eum utïnam detràxit adolésçens, usu éi sale fierént nomïnati. Usù nô elîgendi conclûsionêmque. Pro eïus justô laudêm ea. [m+Cum animal tinçidunt ex, vix inànï popùlô nolùîsse eâ. Error àssûèvérit të vel, vitaê petentîum et nam. Mel eï dictàs latînë, nulla everti mandamus ut est. Atomôrùm rècteqûê ïus ëî, lùdus évêrtitur mëî ut, elïtr prômpta lêgimus êum ïd. Qui cû talé lêgimùs, êlit fêrrï lobortîs cùm ân. [m+Zril possît èléçtram nê sea. Ne êum accusàm dignîssim, fêugàît impërdïèt ratïonibùs eam né, graëço effïciàntùr ân nêc. Iùs quàlîsqué suscipiantur ne. Ea vis velit làtiné nûmquam. Ei nam pondêrum vérterem. At tâmquàm comprehensâm sèd, minïmum officîis expetêndis has cu. [m+An errem vèniâm pëtentium usu, unùm intêgré no sèa. Séd ad totâ ullum, vim ut nullàm vidîsse ômittantûr. At qùo iùdïcabït consectètuêr. Ludus feugiât éam cu, pèr êx èrrêm obliqué, ét saêpe consul comprèhênsam sêa. [m+Postëa façïlisi accommodarè has in. Et usu vûlputatë théôphrastùs. Stèt quôt singûlis nec ïn, id pêr mènandrï consequùntûr. Pro id inani fâbellas. Prï té utamur învênïre, eî sèd inanî mèdiocrêm, êt pôssim impetus épicurî qùo. [m+Mél èx mnésarçhum consètëtur, hîs dicant praesent qûalisqùe tê, dêbitîs perseçûti ei vél. Dïceret repudîàndae ét mea, his id nâtùm fabëllàs àssentïor. Est ad praesènt qûalisque. Sùas brùtë pèrtïnacia nô pér, at vim màgna zrïl desèrûissê. Për voçent fïérènt singulïs èt, at fastïdii postulant sêd. [m+Qûem modô pri çû, ad ïus numqûam dolores sûàvitaté, êa vim sônèt partem possim. Sëâ qûém vitae similiqûê cù. Et mei nûllâ érrém discérè, éà dolor utroqué scriptorèm eàm. Lâudém sîgniferumquè cu est, êx nôstro audïam accommodârè hïs. Nëc ad èvérti aliqûando. [m+Sed ad veri reprimique hônestatîs, èa sed vérïtùs admodum. Mâzim ômnésqùè mediocritatem eù ëum, ad vix qûëm vîvéndo ïnvènïré, ex nêç laborês antiopàm. Eam éx dêbét susçipït. Qùô optîon appareât ëx, mêl primà latiné êû. [m+Ea eum fûgit facilisi volutpat. At purto sèntentiae sît, porro tâtïon habemûs meï êt, tè vïm pôstéâ pértïnacia. Eos aùtém hàrum ei. Vïs të çetero timeam reprimiqûe, latiné admodum ôportéât méi ad. [m+Et prô suàs qûando voluptàtum, possît feûgait id vis. Nô îllûd novùm dëlectus vix. Ei altera tâmquam séd, séa no èîrmod torqûatos. Cum ut justo oporterê réctèque, ïn çum érant sîmul ponderum, vis quôt ridëns êi. [m+Nostrûm contentiones te vis, mûtat facilis sènsêrît pri în, ne est ïudîcô postéâ expêténdis. Vêlît vidîsse instructior his ân. Id vïm âpërïri alïquam intérèssêt, sit ëa légendos persécûti constïtuàm, eu sùmo dïspùtàtionî meâ. Postèa tritàni delëctùs at hïs, pri vivêndùm pérçipïtùr âd, êxerci scrïpta his ne. An utamùr ôblïquè perpetuà mèa. [m+Graeco forénsibûs has eû, ea appétëré sëntêntîâé sit, dîctà pûtant ïnteréssèt éum cû. Quèm errém çonsêctètûêr prî ïn. Pôrro solét qûando ést ét, diçàm labîtùr epicurei pro ea. At nëç voluptua recusabo pëtêntïùm, ut sëd feûgait pèrséquérîs. Te érïpuit dissentiet per, tè virïs cètèro pérsïus quô, essê aèqûe luptatum cù pro. [m+Ad mucius postéa dûo, éi consul lùptàtùm vîx. Eam maiôrum volûptua conclusionemque ad, est âd âlbucius lobortis. At pri primis medîocrèm. Vîs êx odio blandit. Fàstidii vôluptarîa înteressêt àt néc, ad pro quôt qûàs. [m+Nèc id modo erat, ut per labore véreàr sùavitate, pro êx iisquë intèresset. Duo ullùm lâbôrê praësënt ïd. Eu sèa solûm mâzim vocibus, salê çlïtà doctùs duô îd, vïm dolorem prôpriàe sâpïëntêm ët. Facilis vîvéndô té sèà, meï ut latïne âdîpïsci. [m+Quôt môlèstie laboràmus sit êi. In sed assûm vïvëndo âdversàriûm, àn vis rëqué âccusamus. Eâm graecî iisqué scripsèrît êu, ëa quo hâbeô postulànt. Vim possè graèco elàbôrârét cu. [m+In suas sint dèlïcata çùm. Pèrfèçto suscipïântûr în vim, sêa îpsum necéssitatibus ét. Quas aùgùë dêniquê per ïn. Lorèm nïhil abhorrèant ât mea, sit an omnîùm offîcïis, ëst âccùsam legendos intêrêssët çu. [m+Id nêç discèrê hendrêrït, làbore placërat înimicus în mel. Virtùte princîpes vim éû. Nâm àn ërîpûit postulànt hêndrérit. Qui êt argumêntum rëformidans, sùâvïtatè corrùmpit modëratius no vîs, an éam habêmûs mînîmùm. Ad consulatu dispûtationî has. [m+Eà diçta nonumy inîmîcus méa, cum te nibh lôrem labôre. Quôd éxerci ïùs àd, audiàm opôrteat éi vîx. No nêç dicàt nùmquàm ïnvidûnt. Mel facetë repùdiarè ut. Ea séd muciùs facëté, utamùr cônstitûam in pér. [m+Usu suscipit antiopam né, est librîs semper ùllamcôrper té. Ad mèl phâëdrum acçûsatà, his no option vulputate, èi magna solum deseruisse eum. Prï duïs deserunt vôluptatïbus eû. Sït ât debet offéndit copiosaé, diçèrèt constitùam vis èt. Adoléscéns pêrçipitûr id sèà. [m+At ômniùm fabùlas dissèntiàs prï, nonumès deseruîssé duo èâ. Ea mêâ viris ïgnotà, duo cù tantàs nominàti ocurrèrêt. Vel nusquam placerat ëî, no nâm prîmà prompta suscipït. Erat homero mea ét. [m+Cûm blândit petentium ût. Stèt demoçrîtum nè vîm, velït rîdens în sèd, vix an minim légëndos. Salê petentiûm sçrîptorém ut mêl. Exërci accusam an vïm, méî fèrri librïs ànimal àn, sëd în dïam commùne tacimates. [m+Consul périculâ qùo id, illud dolorem vel éx. Ad cum singûlis cotîdieqûé, talé diçtas doçtus cu eos. Et sît ùbiqué àlïquip percipitur, vim ômnesque assùêverît ad, ést éù discerê mandàmùs. Eù putant fabellas cum, dèlenïtî invîdûnt contentîones duo in. [m+Eos in nostrô faceté accusâmus, vîx essent tâmquam ad, duo în alterâ tritàni assûeverit. Pèr ei dètràxit phaêdrûm. Pèr ân wisi vocënt çôntentîonês, quï jùsto çhoro platonem nè. Eos ét esse sensibus éxplicâri, usu élît cèteros et. [m+Eum propriàé expêtenda în. Sit impedit ïmperdiêt ullâmcorpér tê, nostro commûné vulputâtê mei ét, nostèr sçàevolâ cum êù. Sit voçibus probatus cômplêctîtur cu, vel îd âdmodùm inimiçus, sit ad ùtînàm sâlûtatus rèfèrrêntùr. Lâbôré noluisse intéresset usu ea, èï àrgùmentum vitupèratorîbus mel. Ex sît novum rêgîoné, ïllud phaedrùm vim id. Id lorêm aliênum âccusàta sit. [m+Ut pùtant dolorés eleifend vïs, ét nibh luptàtûm posidoniûm îûs, his dèbitis dêlicata neglegêntur îd. Duo casè oràtio ëûîsmod id, sëa in wïsï volumus inîmiçûs. Dômîng putent recteque quo at. Etîam sëmper ornàtûs ét èam. Eû tôllït molèstié vêrtèrêm cum. [m+Quem èquidêm molestiaè ex nêc. Enim sôleat laborë méi at. Nëc dico fâbûlàs sçaëvola ex, vim éi vïtàë detracto vulpùtatè. Unum lûptatum élaborâret vèl ex, sît éu dîam lîbrîs mùcïus. Cum noster tîbïquè îd, at séd mutat âncîllae. Séà éx prïmis constitùto, vix tê èsse përcîpit vitùperata, mea suâvîtate dîspùtàndo no. [m+Id qui adhûc possït, làborê vïdissè përsecuti ïus no. Iuvarèt invênîre convénîre té méï, fàcete ancillaè oportere duô ad. Quot hômérô dôçtùs ad vèl. Ut eàm illud lègere, vulputaté ullamcorper mêa et. Qùot èpîçurï âncillae àd duô. Cù qui nusqûam sapïëntèm sàlutândï, âdhùc légendos at pri, an fùîssét pertïnax vel. Ut néc soléat vûlpûtàte, îd verïtùs mândamus perseqùeris qûî, èst sôlét phàèdrum in. [m+Usû ei dénîque vertèrêm delîcata, àn nàm quàs vïvèndum àbhorrèànt, çu homêrô consùlàtù usû. Cum lorêm dêçôre aliqûid tê, êst ut facète appellàntur. Nô natum ullum appetère nam, ex veniâm âperiri consétètur vix. Ad qûî prima rëbum placerat, nec sénsïbus laborâmus at. Pro màgna bonôrum évèrtitur nê, per àt reçusabo salùtatùs. Ut nam soluta postulant corrumpit, minîmùm recûsâbô posidoniûm ëst ât. [m+Ad iûs dicêrèt fâbûlâs conclùdatûrque. Pro ex copiosaé tïncïdunt, nâm tollït simïlique çonséqùuntur îd. Tôta phîlôsophia èt vél. No est errém feùgïat, vix impètus întèrprëtaris no. Tractatos dêfînïtionèm qui ëi, quot tollït ëst ad. [m+Nêc sançtus epicuri àccùsata et. Debitis persëcutï no qùi, feùgait patriôquë in çum, putànt vivëndum phaédrûm àn pri. Id eôs suas qùot, omniùm luptatum întèllégat mei tê. Omnés virtute copiosaè ne sêd. [m+Sed ad veri. [m
tests/out/lorem_Lorem-ioZbest1.out
@@ -0,0 +1,2 @@+[1;4;32mlorem[m+[1;4;32mlorem[m
tests/out/lorem_nomatch-Zio.out
tests/out/lorem_nomatch-ioZbest1.out
@@ -213,8 +213,13 @@ if [ "$have_pcre2" == yes ]; then || ERR "-P -iwco -f lorem lorem.latin1.txt" fi -printf .-$UG -Zio Lorem lorem.utf8.txt | $DIFF out/lorem_Lorem-Zio.out || ERR "-Zio Lorem lorem.utf8.txt"+for PAT in '' 'Lorem' 'nomatch' ; do+ FN=`echo "lorem_$PAT" | tr -Cd '[:alnum:]_'`+ for OPS in '-Zio' '-ioZbest1' ; do+ printf .+ $UG $OPS "$PAT" lorem.utf8.txt | $DIFF out/$FN$OPS.out || ERR "$OPS '$PAT' lorem.utf8.txt"+ done+done printf . $UG -ci hello $FILES \