mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-23 07:45:23 +00:00
case consistency part 6
This commit is contained in:
@@ -56,7 +56,7 @@ var
|
||||
|
||||
proc ask(msg: string): string =
|
||||
stdout.write(msg)
|
||||
result = stdin.readline()
|
||||
result = stdin.readLine()
|
||||
|
||||
proc Confirm: TConfirmEnum =
|
||||
while true:
|
||||
@@ -66,7 +66,7 @@ proc Confirm: TConfirmEnum =
|
||||
of "l", "all": return ceAll
|
||||
of "n", "no": return ceNo
|
||||
of "e", "none": return ceNone
|
||||
else: nil
|
||||
else: discard
|
||||
|
||||
proc countLines(s: string, first, last: int): int =
|
||||
var i = first
|
||||
@@ -308,7 +308,7 @@ checkOptions({optIgnoreCase, optIgnoreStyle}, "ignore_case", "ignore_style")
|
||||
|
||||
if optStdin in options:
|
||||
pattern = ask("pattern [ENTER to exit]: ")
|
||||
if IsNil(pattern) or pattern.len == 0: quit(0)
|
||||
if isNil(pattern) or pattern.len == 0: quit(0)
|
||||
if optReplace in options:
|
||||
replacement = ask("replacement [supports $1, $# notations]: ")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user