diff options
author | Araq <rumpf_a@web.de> | 2019-05-16 12:59:44 +0200 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2019-05-22 07:41:16 +0200 |
commit | 845f89ab54ae73786e26eb76a5ee3bbeba52d000 (patch) | |
tree | a04535d0d74c1a482aaa95d84663ed157f12c6b9 /tools | |
parent | 23dbc9ad58bd2dbfa2e877196d3f1019e0df5048 (diff) | |
download | Nim-845f89ab54ae73786e26eb76a5ee3bbeba52d000.tar.gz |
better default for nimgrep
Diffstat (limited to 'tools')
-rw-r--r-- | tools/nimgrep.nim | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/tools/nimgrep.nim b/tools/nimgrep.nim index 0a835b038..44416895c 100644 --- a/tools/nimgrep.nim +++ b/tools/nimgrep.nim @@ -11,7 +11,7 @@ import os, strutils, parseopt, pegs, re, terminal const - Version = "1.2" + Version = "1.3" Usage = "nimgrep - Nim Grep Utility Version " & Version & """ (c) 2012 Andreas Rumpf @@ -33,7 +33,7 @@ Options: --ignoreStyle, -y be style insensitive --ext:EX1|EX2|... only search the files with the given extension(s) --nocolor output will be given without any colours. - --oneline show file on each matched line + --group group matches by file --verbose be verbose: list every processed file --filenames find the pattern in the filenames, not in the contents of the file @@ -268,6 +268,7 @@ proc checkOptions(subset: TOptions, a, b: string) = if subset <= options: quit("cannot specify both '$#' and '$#'" % [a, b]) +oneline = true for kind, key, val in getopt(): case kind of cmdArgument: @@ -298,6 +299,7 @@ for kind, key, val in getopt(): of "ext": extensions.add val.split('|') of "nocolor": useWriteStyled = false of "oneline": oneline = true + of "group": oneline = false of "verbose": incl(options, optVerbose) of "filenames": incl(options, optFilenames) of "help", "h": writeHelp() |