diff options
-rw-r--r-- | lib/pure/parseopt.nim | 2 | ||||
-rw-r--r-- | tools/nimgrep.nim | 12 |
2 files changed, 7 insertions, 7 deletions
diff --git a/lib/pure/parseopt.nim b/lib/pure/parseopt.nim index 786744600..8af6920c1 100644 --- a/lib/pure/parseopt.nim +++ b/lib/pure/parseopt.nim @@ -25,7 +25,7 @@ type CmdLineKind* = enum ## the detected command line token cmdEnd, ## end of command line reached cmdArgument, ## argument detected - cmdLongoption, ## a long option ``--option`` detected + cmdLongOption, ## a long option ``--option`` detected cmdShortOption ## a short option ``-c`` detected OptParser* = object of RootObj ## this object implements the command line parser diff --git a/tools/nimgrep.nim b/tools/nimgrep.nim index 42db2dafc..a38f2a88f 100644 --- a/tools/nimgrep.nim +++ b/tools/nimgrep.nim @@ -81,14 +81,14 @@ proc countLines(s: string, first, last: int): int = proc beforePattern(s: string, first: int): int = result = first-1 while result >= 0: - if s[result] in Newlines: break + if s[result] in NewLines: break dec(result) inc(result) proc afterPattern(s: string, last: int): int = result = last+1 while result < s.len: - if s[result] in Newlines: break + if s[result] in NewLines: break inc(result) dec(result) @@ -125,12 +125,12 @@ proc processFile(filename: string) = var buffer: string try: buffer = system.readFile(filename) - except EIO: + except IOError: echo "cannot open file: ", filename return if optVerbose in options: stdout.writeln(filename) var pegp: TPeg - var rep: TRegex + var rep: Regex var result: string if optRegex in options: @@ -267,7 +267,7 @@ proc checkOptions(subset: TOptions, a, b: string) = for kind, key, val in getopt(): case kind of cmdArgument: - if options.contains(optStdIn): + if options.contains(optStdin): filenames.add(key) elif pattern.len == 0: pattern = key @@ -275,7 +275,7 @@ for kind, key, val in getopt(): replacement = key else: filenames.add(key) - of cmdLongOption, cmdShortOption: + of cmdLongoption, cmdShortOption: case normalize(key) of "find", "f": incl(options, optFind) of "replace", "r": incl(options, optReplace) |