compiler/commands: Always write usage to stdout
Usage is compiler command output, not diagnostics, so we shall output it to stdout. Also this makes: nim -h | less or nim -h | grep ... working.
This commit is contained in:
parent
acb6a36656
commit
24731c5360
1 changed files with 4 additions and 3 deletions
|
|
@ -65,14 +65,15 @@ proc getCommandLineDesc(): string =
|
||||||
|
|
||||||
proc helpOnError(pass: TCmdLinePass) =
|
proc helpOnError(pass: TCmdLinePass) =
|
||||||
if pass == passCmd1:
|
if pass == passCmd1:
|
||||||
msgWriteln(getCommandLineDesc())
|
msgWriteln(getCommandLineDesc(), {msgStdout})
|
||||||
msgQuit(0)
|
msgQuit(0)
|
||||||
|
|
||||||
proc writeAdvancedUsage(pass: TCmdLinePass) =
|
proc writeAdvancedUsage(pass: TCmdLinePass) =
|
||||||
if pass == passCmd1:
|
if pass == passCmd1:
|
||||||
msgWriteln(`%`(HelpMessage, [VersionAsString,
|
msgWriteln(`%`(HelpMessage, [VersionAsString,
|
||||||
platform.OS[platform.hostOS].name,
|
platform.OS[platform.hostOS].name,
|
||||||
CPU[platform.hostCPU].name]) & AdvancedUsage)
|
CPU[platform.hostCPU].name]) & AdvancedUsage,
|
||||||
|
{msgStdout})
|
||||||
msgQuit(0)
|
msgQuit(0)
|
||||||
|
|
||||||
proc writeVersionInfo(pass: TCmdLinePass) =
|
proc writeVersionInfo(pass: TCmdLinePass) =
|
||||||
|
|
@ -95,7 +96,7 @@ var
|
||||||
|
|
||||||
proc writeCommandLineUsage() =
|
proc writeCommandLineUsage() =
|
||||||
if not helpWritten:
|
if not helpWritten:
|
||||||
msgWriteln(getCommandLineDesc())
|
msgWriteln(getCommandLineDesc(), {msgStdout})
|
||||||
helpWritten = true
|
helpWritten = true
|
||||||
|
|
||||||
proc addPrefix(switch: string): string =
|
proc addPrefix(switch: string): string =
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue