Skip to content

Commit 629c0e1

Browse files
committed
tidy up
update completions for updated options & use -- with TUI pager command
1 parent df26aee commit 629c0e1

10 files changed

Lines changed: 21 additions & 21 deletions

File tree

completions/bash/ug

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -285,15 +285,15 @@ cat <<'END'
285285
-J NUM, --jobs=NUM Specifies the number of threads spawned to search files.
286286
-j, --smart-case Perform case insensitive matching, unless a pattern is specified with a literal upper case letter.
287287
--json Output file matches in JSON.
288-
-K [MIN,][MAX], --range=[MIN,][MAX], --min-line=MIN, --max-line=MAX Start searching at line MIN, stop at line MAX when specified.
288+
-K [MIN,][MAX], --range=[MIN,][MAX], --min-line=MIN, --max-line=MAX Start searching at line MIN, stop reading input after line MAX.
289289
-k, --column-number The column number of a pattern match is displayed in front of the respective matched line, starting at column 1.
290290
-L, --files-without-match Only the names of files not containing selected lines are written to standard output.
291291
-l, --files-with-matches Only the names of files containing selected lines are written to standard output.
292292
--label=LABEL Displays the LABEL value when input is read from standard input where a file name would normally be printed in the output.
293293
--line-buffered Force output to be line buffered instead of block buffered.
294294
--lines Boolean line matching mode for option --bool, the default mode.
295295
-M MAGIC, --file-magic=MAGIC Only search files matching the magic signature pattern MAGIC.
296-
-m [MIN,][MAX], --min-count=MIN, --max-count=MAX Require MIN matches, stop after MAX matches when specified.
296+
-m [MIN,][MAX], --min-count=MIN, --max-count=MAX Require MIN matches, stop reading input upon MAX matches.
297297
--match Match all lines.
298298
--max-files=NUM Restrict the number of files matched to NUM.
299299
--max-size=MAX Only search files whose physical size does not exceed MAX bytes.

completions/fish/ug+.fish

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,15 +63,15 @@ complete -c ug+ -l index -d 'Perform fast index-based recursive search'
6363
complete -c ug+ -s J -r -l jobs -d 'Specifies the number of threads spawned to search files'
6464
complete -c ug+ -s j -l smart-case -d 'Perform case insensitive matching, unless a pattern is specified with a literal upper case letter'
6565
complete -c ug+ -l json -d 'Output file matches in JSON'
66-
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'
66+
complete -c ug+ -s K -r -l range -l min-line -l max-line -d 'Start searching at line MIN, stop reading input after line MAX'
6767
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'
6868
complete -c ug+ -s L -l files-without-match -d 'Only the names of files not containing selected lines are written to standard output'
6969
complete -c ug+ -s l -l files-with-matches -d 'Only the names of files containing selected lines are written to standard output'
7070
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'
7171
complete -c ug+ -l line-buffered -d 'Force output to be line buffered instead of block buffered'
7272
complete -c ug+ -l lines -d 'Boolean line matching mode for option --bool, the default mode'
7373
complete -c ug+ -s M -r -l file-magic -d 'Only search files matching the magic signature pattern MAGIC'
74-
complete -c ug+ -s m -r -l min-count -l max-count -d 'Require MIN matches, stop after MAX matches when specified'
74+
complete -c ug+ -s m -r -l min-count -l max-count -d 'Require MIN matches, stop reading input upon MAX matches'
7575
complete -c ug+ -l match -d 'Match all lines'
7676
complete -c ug+ -l max-files -d 'Restrict the number of files matched to NUM'
7777
complete -c ug+ -l max-size -d 'Only search files whose physical size does not exceed MAX bytes'

completions/fish/ug.fish

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,15 +63,15 @@ complete -c ug -l index -d 'Perform fast index-based recursive search'
6363
complete -c ug -s J -r -l jobs -d 'Specifies the number of threads spawned to search files'
6464
complete -c ug -s j -l smart-case -d 'Perform case insensitive matching, unless a pattern is specified with a literal upper case letter'
6565
complete -c ug -l json -d 'Output file matches in JSON'
66-
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'
66+
complete -c ug -s K -r -l range -l min-line -l max-line -d 'Start searching at line MIN, stop reading input after line MAX'
6767
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'
6868
complete -c ug -s L -l files-without-match -d 'Only the names of files not containing selected lines are written to standard output'
6969
complete -c ug -s l -l files-with-matches -d 'Only the names of files containing selected lines are written to standard output'
7070
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'
7171
complete -c ug -l line-buffered -d 'Force output to be line buffered instead of block buffered'
7272
complete -c ug -l lines -d 'Boolean line matching mode for option --bool, the default mode'
7373
complete -c ug -s M -r -l file-magic -d 'Only search files matching the magic signature pattern MAGIC'
74-
complete -c ug -s m -r -l min-count -l max-count -d 'Require MIN matches, stop after MAX matches when specified'
74+
complete -c ug -s m -r -l min-count -l max-count -d 'Require MIN matches, stop reading input upon MAX matches'
7575
complete -c ug -l match -d 'Match all lines'
7676
complete -c ug -l max-files -d 'Restrict the number of files matched to NUM'
7777
complete -c ug -l max-size -d 'Only search files whose physical size does not exceed MAX bytes'

completions/fish/ugrep+.fish

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,15 +63,15 @@ complete -c ugrep+ -l index -d 'Perform fast index-based recursive search'
6363
complete -c ugrep+ -s J -r -l jobs -d 'Specifies the number of threads spawned to search files'
6464
complete -c ugrep+ -s j -l smart-case -d 'Perform case insensitive matching, unless a pattern is specified with a literal upper case letter'
6565
complete -c ugrep+ -l json -d 'Output file matches in JSON'
66-
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'
66+
complete -c ugrep+ -s K -r -l range -l min-line -l max-line -d 'Start searching at line MIN, stop reading input after line MAX'
6767
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'
6868
complete -c ugrep+ -s L -l files-without-match -d 'Only the names of files not containing selected lines are written to standard output'
6969
complete -c ugrep+ -s l -l files-with-matches -d 'Only the names of files containing selected lines are written to standard output'
7070
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'
7171
complete -c ugrep+ -l line-buffered -d 'Force output to be line buffered instead of block buffered'
7272
complete -c ugrep+ -l lines -d 'Boolean line matching mode for option --bool, the default mode'
7373
complete -c ugrep+ -s M -r -l file-magic -d 'Only search files matching the magic signature pattern MAGIC'
74-
complete -c ugrep+ -s m -r -l min-count -l max-count -d 'Require MIN matches, stop after MAX matches when specified'
74+
complete -c ugrep+ -s m -r -l min-count -l max-count -d 'Require MIN matches, stop reading input upon MAX matches'
7575
complete -c ugrep+ -l match -d 'Match all lines'
7676
complete -c ugrep+ -l max-files -d 'Restrict the number of files matched to NUM'
7777
complete -c ugrep+ -l max-size -d 'Only search files whose physical size does not exceed MAX bytes'

completions/fish/ugrep.fish

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,15 +63,15 @@ complete -c ugrep -l index -d 'Perform fast index-based recursive search'
6363
complete -c ugrep -s J -r -l jobs -d 'Specifies the number of threads spawned to search files'
6464
complete -c ugrep -s j -l smart-case -d 'Perform case insensitive matching, unless a pattern is specified with a literal upper case letter'
6565
complete -c ugrep -l json -d 'Output file matches in JSON'
66-
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'
66+
complete -c ugrep -s K -r -l range -l min-line -l max-line -d 'Start searching at line MIN, stop reading input after line MAX'
6767
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'
6868
complete -c ugrep -s L -l files-without-match -d 'Only the names of files not containing selected lines are written to standard output'
6969
complete -c ugrep -s l -l files-with-matches -d 'Only the names of files containing selected lines are written to standard output'
7070
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'
7171
complete -c ugrep -l line-buffered -d 'Force output to be line buffered instead of block buffered'
7272
complete -c ugrep -l lines -d 'Boolean line matching mode for option --bool, the default mode'
7373
complete -c ugrep -s M -r -l file-magic -d 'Only search files matching the magic signature pattern MAGIC'
74-
complete -c ugrep -s m -r -l min-count -l max-count -d 'Require MIN matches, stop after MAX matches when specified'
74+
complete -c ugrep -s m -r -l min-count -l max-count -d 'Require MIN matches, stop reading input upon MAX matches'
7575
complete -c ugrep -l match -d 'Match all lines'
7676
complete -c ugrep -l max-files -d 'Restrict the number of files matched to NUM'
7777
complete -c ugrep -l max-size -d 'Only search files whose physical size does not exceed MAX bytes'

completions/zsh/_ug

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,15 +70,15 @@ $matchers{-G,--basic-regexp}'[Interpret patterns as basic regular expressions (B
7070
{-J,--jobs=-}'[Specifies the number of threads spawned to search files]:NUM:( )'
7171
{-j,--smart-case}'[Perform case insensitive matching, unless a pattern is specified with a literal upper case letter]'
7272
--json'[Output file matches in JSON]'
73-
{-K,--range=-,--min-line=-,--max-line=-}'[Start searching at line MIN, stop at line MAX when specified]:MIN,MAX:( )'
73+
{-K,--range=-,--min-line=-,--max-line=-}'[Start searching at line MIN, stop reading input after line MAX]:MIN,MAX:( )'
7474
{-k,--column-number}'[The column number of a pattern match is displayed in front of the respective matched line, starting at column 1]'
7575
{-L,--files-without-match}'[Only the names of files not containing selected lines are written to standard output]'
7676
{-l,--files-with-matches}'[Only the names of files containing selected lines are written to standard output]'
7777
--label=-'[Displays the LABEL value when input is read from standard input where a file name would normally be printed in the output]'
7878
--line-buffered'[Force output to be line buffered instead of block buffered]'
7979
--lines'[Boolean line matching mode for option --bool, the default mode]'
8080
'(1)*'{-M,--file-magic=-}'[Only search files matching the magic signature pattern MAGIC]:PATTERN:( )'
81-
{-m,--min-count=-,--max-count=-}'[Require MIN matches, stop after MAX matches when specified]:MIN,MAX:( )::(1 1, 1,10)'
81+
{-m,--min-count=-,--max-count=-}'[Require MIN matches, stop reading input upon MAX matches]:MIN,MAX:( )::(1 1, 1,10)'
8282
--match'[Match all lines]'
8383
--max-files=-'[Restrict the number of files matched to NUM]'
8484
--max-size=-'[Only search files whose physical size does not exceed MAX bytes]'

completions/zsh/_ug+

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,15 +70,15 @@ $matchers{-G,--basic-regexp}'[Interpret patterns as basic regular expressions (B
7070
{-J,--jobs=-}'[Specifies the number of threads spawned to search files]:NUM:( )'
7171
{-j,--smart-case}'[Perform case insensitive matching, unless a pattern is specified with a literal upper case letter]'
7272
--json'[Output file matches in JSON]'
73-
{-K,--range=-,--min-line=-,--max-line=-}'[Start searching at line MIN, stop at line MAX when specified]:MIN,MAX:( )'
73+
{-K,--range=-,--min-line=-,--max-line=-}'[Start searching at line MIN, stop reading input after line MAX]:MIN,MAX:( )'
7474
{-k,--column-number}'[The column number of a pattern match is displayed in front of the respective matched line, starting at column 1]'
7575
{-L,--files-without-match}'[Only the names of files not containing selected lines are written to standard output]'
7676
{-l,--files-with-matches}'[Only the names of files containing selected lines are written to standard output]'
7777
--label=-'[Displays the LABEL value when input is read from standard input where a file name would normally be printed in the output]'
7878
--line-buffered'[Force output to be line buffered instead of block buffered]'
7979
--lines'[Boolean line matching mode for option --bool, the default mode]'
8080
'(1)*'{-M,--file-magic=-}'[Only search files matching the magic signature pattern MAGIC]:PATTERN:( )'
81-
{-m,--min-count=-,--max-count=-}'[Require MIN matches, stop after MAX matches when specified]:MIN,MAX:( )::(1 1, 1,10)'
81+
{-m,--min-count=-,--max-count=-}'[Require MIN matches, stop reading input upon MAX matches]:MIN,MAX:( )::(1 1, 1,10)'
8282
--match'[Match all lines]'
8383
--max-files=-'[Restrict the number of files matched to NUM]'
8484
--max-size=-'[Only search files whose physical size does not exceed MAX bytes]'

completions/zsh/_ugrep

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,15 +70,15 @@ $matchers{-G,--basic-regexp}'[Interpret patterns as basic regular expressions (B
7070
{-J,--jobs=-}'[Specifies the number of threads spawned to search files]:NUM:( )'
7171
{-j,--smart-case}'[Perform case insensitive matching, unless a pattern is specified with a literal upper case letter]'
7272
--json'[Output file matches in JSON]'
73-
{-K,--range=-,--min-line=-,--max-line=-}'[Start searching at line MIN, stop at line MAX when specified]:MIN,MAX:( )'
73+
{-K,--range=-,--min-line=-,--max-line=-}'[Start searching at line MIN, stop reading input after line MAX]:MIN,MAX:( )'
7474
{-k,--column-number}'[The column number of a pattern match is displayed in front of the respective matched line, starting at column 1]'
7575
{-L,--files-without-match}'[Only the names of files not containing selected lines are written to standard output]'
7676
{-l,--files-with-matches}'[Only the names of files containing selected lines are written to standard output]'
7777
--label=-'[Displays the LABEL value when input is read from standard input where a file name would normally be printed in the output]'
7878
--line-buffered'[Force output to be line buffered instead of block buffered]'
7979
--lines'[Boolean line matching mode for option --bool, the default mode]'
8080
'(1)*'{-M,--file-magic=-}'[Only search files matching the magic signature pattern MAGIC]:PATTERN:( )'
81-
{-m,--min-count=-,--max-count=-}'[Require MIN matches, stop after MAX matches when specified]:MIN,MAX:( )::(1 1, 1,10)'
81+
{-m,--min-count=-,--max-count=-}'[Require MIN matches, stop reading input upon MAX matches]:MIN,MAX:( )::(1 1, 1,10)'
8282
--match'[Match all lines]'
8383
--max-files=-'[Restrict the number of files matched to NUM]'
8484
--max-size=-'[Only search files whose physical size does not exceed MAX bytes]'

completions/zsh/_ugrep+

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,15 +70,15 @@ $matchers{-G,--basic-regexp}'[Interpret patterns as basic regular expressions (B
7070
{-J,--jobs=-}'[Specifies the number of threads spawned to search files]:NUM:( )'
7171
{-j,--smart-case}'[Perform case insensitive matching, unless a pattern is specified with a literal upper case letter]'
7272
--json'[Output file matches in JSON]'
73-
{-K,--range=-,--min-line=-,--max-line=-}'[Start searching at line MIN, stop at line MAX when specified]:MIN,MAX:( )'
73+
{-K,--range=-,--min-line=-,--max-line=-}'[Start searching at line MIN, stop reading input after line MAX]:MIN,MAX:( )'
7474
{-k,--column-number}'[The column number of a pattern match is displayed in front of the respective matched line, starting at column 1]'
7575
{-L,--files-without-match}'[Only the names of files not containing selected lines are written to standard output]'
7676
{-l,--files-with-matches}'[Only the names of files containing selected lines are written to standard output]'
7777
--label=-'[Displays the LABEL value when input is read from standard input where a file name would normally be printed in the output]'
7878
--line-buffered'[Force output to be line buffered instead of block buffered]'
7979
--lines'[Boolean line matching mode for option --bool, the default mode]'
8080
'(1)*'{-M,--file-magic=-}'[Only search files matching the magic signature pattern MAGIC]:PATTERN:( )'
81-
{-m,--min-count=-,--max-count=-}'[Require MIN matches, stop after MAX matches when specified]:MIN,MAX:( )::(1 1, 1,10)'
81+
{-m,--min-count=-,--max-count=-}'[Require MIN matches, stop reading input upon MAX matches]:MIN,MAX:( )::(1 1, 1,10)'
8282
--match'[Match all lines]'
8383
--max-files=-'[Restrict the number of files matched to NUM]'
8484
--max-size=-'[Only search files whose physical size does not exceed MAX bytes]'

src/query.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2529,7 +2529,7 @@ void Query::view()
25292529
else
25302530
{
25312531
#ifdef OS_WIN
2532-
if (filename.find('"') != std::string::npos)
2532+
if (filename.empty() || filename.at(0) == '/' || filename.find('"') != std::string::npos)
25332533
{
25342534
// illegal filename in Windows, should never happen, but just in case
25352535
Screen::alert();
@@ -2548,8 +2548,8 @@ void Query::view()
25482548
Screen::alert();
25492549
return;
25502550
}
2551-
// view file in the pager using system() call
2552-
command.append(" '").append(filename).append("'");
2551+
// view file in the pager using system() call, double -- ends options
2552+
command.append(" -- '").append(filename).append("'");
25532553
#endif
25542554
}
25552555

0 commit comments

Comments
 (0)