better default for nimgrep
This commit is contained in:
parent
23dbc9ad58
commit
845f89ab54
1 changed files with 4 additions and 2 deletions
|
|
@ -11,7 +11,7 @@ import
|
||||||
os, strutils, parseopt, pegs, re, terminal
|
os, strutils, parseopt, pegs, re, terminal
|
||||||
|
|
||||||
const
|
const
|
||||||
Version = "1.2"
|
Version = "1.3"
|
||||||
Usage = "nimgrep - Nim Grep Utility Version " & Version & """
|
Usage = "nimgrep - Nim Grep Utility Version " & Version & """
|
||||||
|
|
||||||
(c) 2012 Andreas Rumpf
|
(c) 2012 Andreas Rumpf
|
||||||
|
|
@ -33,7 +33,7 @@ Options:
|
||||||
--ignoreStyle, -y be style insensitive
|
--ignoreStyle, -y be style insensitive
|
||||||
--ext:EX1|EX2|... only search the files with the given extension(s)
|
--ext:EX1|EX2|... only search the files with the given extension(s)
|
||||||
--nocolor output will be given without any colours.
|
--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
|
--verbose be verbose: list every processed file
|
||||||
--filenames find the pattern in the filenames, not in the contents
|
--filenames find the pattern in the filenames, not in the contents
|
||||||
of the file
|
of the file
|
||||||
|
|
@ -268,6 +268,7 @@ proc checkOptions(subset: TOptions, a, b: string) =
|
||||||
if subset <= options:
|
if subset <= options:
|
||||||
quit("cannot specify both '$#' and '$#'" % [a, b])
|
quit("cannot specify both '$#' and '$#'" % [a, b])
|
||||||
|
|
||||||
|
oneline = true
|
||||||
for kind, key, val in getopt():
|
for kind, key, val in getopt():
|
||||||
case kind
|
case kind
|
||||||
of cmdArgument:
|
of cmdArgument:
|
||||||
|
|
@ -298,6 +299,7 @@ for kind, key, val in getopt():
|
||||||
of "ext": extensions.add val.split('|')
|
of "ext": extensions.add val.split('|')
|
||||||
of "nocolor": useWriteStyled = false
|
of "nocolor": useWriteStyled = false
|
||||||
of "oneline": oneline = true
|
of "oneline": oneline = true
|
||||||
|
of "group": oneline = false
|
||||||
of "verbose": incl(options, optVerbose)
|
of "verbose": incl(options, optVerbose)
|
||||||
of "filenames": incl(options, optFilenames)
|
of "filenames": incl(options, optFilenames)
|
||||||
of "help", "h": writeHelp()
|
of "help", "h": writeHelp()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue