Fixed terminal module so that it doesn't raise an EOS exception when stdout is redirected.
This commit is contained in:
parent
317675d5e5
commit
9540a93d95
2 changed files with 334 additions and 334 deletions
|
|
@ -39,8 +39,6 @@ when defined(windows):
|
||||||
# workaround Windows bugs: try several times
|
# workaround Windows bugs: try several times
|
||||||
if GetConsoleScreenBufferInfo(conHandle, addr(c)) != 0:
|
if GetConsoleScreenBufferInfo(conHandle, addr(c)) != 0:
|
||||||
return c.wAttributes
|
return c.wAttributes
|
||||||
else:
|
|
||||||
OSError()
|
|
||||||
return 0x70'i16 # ERROR: return white background, black text
|
return 0x70'i16 # ERROR: return white background, black text
|
||||||
|
|
||||||
var
|
var
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,7 @@ Options:
|
||||||
--ignoreCase, -i be case insensitive
|
--ignoreCase, -i be case insensitive
|
||||||
--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.
|
||||||
--verbose be verbose: list every processed file
|
--verbose be verbose: list every processed file
|
||||||
--help, -h shows this help
|
--help, -h shows this help
|
||||||
--version, -v shows the version
|
--version, -v shows the version
|
||||||
|
|
@ -291,6 +292,7 @@ for kind, key, val in getopt():
|
||||||
of "ignorecase", "i": incl(options, optIgnoreCase)
|
of "ignorecase", "i": incl(options, optIgnoreCase)
|
||||||
of "ignorestyle", "y": incl(options, optIgnoreStyle)
|
of "ignorestyle", "y": incl(options, optIgnoreStyle)
|
||||||
of "ext": extensions = val.split('|')
|
of "ext": extensions = val.split('|')
|
||||||
|
of "nocolor": useWriteStyled = false
|
||||||
of "verbose": incl(options, optVerbose)
|
of "verbose": incl(options, optVerbose)
|
||||||
of "help", "h": writeHelp()
|
of "help", "h": writeHelp()
|
||||||
of "version", "v": writeVersion()
|
of "version", "v": writeVersion()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue