Turn execExternalProgram msgs into hintExecuting
Or hintLinking that is used on verbosity:1. This lets you treat this message as regular hint, and control it via command line.
This commit is contained in:
parent
592f867aa5
commit
18b3d04291
2 changed files with 13 additions and 14 deletions
|
|
@ -438,16 +438,12 @@ proc addFileToLink*(filename: string) =
|
||||||
prependStr(toLink, filename)
|
prependStr(toLink, filename)
|
||||||
# BUGFIX: was ``appendStr``
|
# BUGFIX: was ``appendStr``
|
||||||
|
|
||||||
proc execWithEcho(cmd: string, prettyCmd = ""): int =
|
proc execWithEcho(cmd: string, msg = hintExecuting): int =
|
||||||
if optListCmd in gGlobalOptions or gVerbosity > 0:
|
rawMessage(msg, cmd)
|
||||||
if prettyCmd != "":
|
|
||||||
msgWriteln(prettyCmd)
|
|
||||||
else:
|
|
||||||
msgWriteln(cmd)
|
|
||||||
result = execCmd(cmd)
|
result = execCmd(cmd)
|
||||||
|
|
||||||
proc execExternalProgram*(cmd: string, prettyCmd = "") =
|
proc execExternalProgram*(cmd: string, msg = hintExecuting) =
|
||||||
if execWithEcho(cmd, prettyCmd) != 0:
|
if execWithEcho(cmd, msg) != 0:
|
||||||
rawMessage(errExecutionOfProgramFailed, "")
|
rawMessage(errExecutionOfProgramFailed, "")
|
||||||
|
|
||||||
proc generateScript(projectFile: string, script: Rope) =
|
proc generateScript(projectFile: string, script: Rope) =
|
||||||
|
|
@ -703,10 +699,8 @@ proc callCCompiler*(projectfile: string) =
|
||||||
"nim", quoteShell(getPrefixDir()),
|
"nim", quoteShell(getPrefixDir()),
|
||||||
"lib", quoteShell(libpath)])
|
"lib", quoteShell(libpath)])
|
||||||
if optCompileOnly notin gGlobalOptions:
|
if optCompileOnly notin gGlobalOptions:
|
||||||
if gVerbosity == 1:
|
execExternalProgram(linkCmd,
|
||||||
execExternalProgram(linkCmd, "[Linking]")
|
if gVerbosity > 1: hintExecuting else: hintLinking)
|
||||||
else:
|
|
||||||
execExternalProgram(linkCmd)
|
|
||||||
else:
|
else:
|
||||||
linkCmd = ""
|
linkCmd = ""
|
||||||
if optGenScript in gGlobalOptions:
|
if optGenScript in gGlobalOptions:
|
||||||
|
|
|
||||||
|
|
@ -126,6 +126,7 @@ type
|
||||||
hintConvFromXtoItselfNotNeeded, hintExprAlwaysX, hintQuitCalled,
|
hintConvFromXtoItselfNotNeeded, hintExprAlwaysX, hintQuitCalled,
|
||||||
hintProcessing, hintCodeBegin, hintCodeEnd, hintConf, hintPath,
|
hintProcessing, hintCodeBegin, hintCodeEnd, hintConf, hintPath,
|
||||||
hintConditionAlwaysTrue, hintName, hintPattern,
|
hintConditionAlwaysTrue, hintName, hintPattern,
|
||||||
|
hintExecuting, hintLinking,
|
||||||
hintUser
|
hintUser
|
||||||
|
|
||||||
const
|
const
|
||||||
|
|
@ -416,6 +417,8 @@ const
|
||||||
hintConditionAlwaysTrue: "condition is always true: '$1'",
|
hintConditionAlwaysTrue: "condition is always true: '$1'",
|
||||||
hintName: "name should be: '$1'",
|
hintName: "name should be: '$1'",
|
||||||
hintPattern: "$1",
|
hintPattern: "$1",
|
||||||
|
hintExecuting: "$1",
|
||||||
|
hintLinking: "",
|
||||||
hintUser: "$1"]
|
hintUser: "$1"]
|
||||||
|
|
||||||
const
|
const
|
||||||
|
|
@ -431,10 +434,10 @@ const
|
||||||
"ProveInit", "ProveField", "ProveIndex", "GcUnsafe", "GcUnsafe2", "Uninit",
|
"ProveInit", "ProveField", "ProveIndex", "GcUnsafe", "GcUnsafe2", "Uninit",
|
||||||
"GcMem", "Destructor", "LockLevel", "ResultShadowed", "User"]
|
"GcMem", "Destructor", "LockLevel", "ResultShadowed", "User"]
|
||||||
|
|
||||||
HintsToStr*: array[0..16, string] = ["Success", "SuccessX", "LineTooLong",
|
HintsToStr*: array[0..18, string] = ["Success", "SuccessX", "LineTooLong",
|
||||||
"XDeclaredButNotUsed", "ConvToBaseNotNeeded", "ConvFromXtoItselfNotNeeded",
|
"XDeclaredButNotUsed", "ConvToBaseNotNeeded", "ConvFromXtoItselfNotNeeded",
|
||||||
"ExprAlwaysX", "QuitCalled", "Processing", "CodeBegin", "CodeEnd", "Conf",
|
"ExprAlwaysX", "QuitCalled", "Processing", "CodeBegin", "CodeEnd", "Conf",
|
||||||
"Path", "CondTrue", "Name", "Pattern",
|
"Path", "CondTrue", "Name", "Pattern", "Exec", "Link",
|
||||||
"User"]
|
"User"]
|
||||||
|
|
||||||
const
|
const
|
||||||
|
|
@ -492,10 +495,12 @@ const
|
||||||
warnGcUnsafe,
|
warnGcUnsafe,
|
||||||
hintSuccessX, hintPath, hintConf,
|
hintSuccessX, hintPath, hintConf,
|
||||||
hintProcessing,
|
hintProcessing,
|
||||||
|
hintExecuting, hintLinking,
|
||||||
hintCodeBegin, hintCodeEnd},
|
hintCodeBegin, hintCodeEnd},
|
||||||
{low(TNoteKind)..high(TNoteKind)} - {warnShadowIdent, warnUninit,
|
{low(TNoteKind)..high(TNoteKind)} - {warnShadowIdent, warnUninit,
|
||||||
warnProveField, warnProveIndex,
|
warnProveField, warnProveIndex,
|
||||||
warnGcUnsafe,
|
warnGcUnsafe,
|
||||||
|
hintExecuting,
|
||||||
hintCodeBegin, hintCodeEnd},
|
hintCodeBegin, hintCodeEnd},
|
||||||
{low(TNoteKind)..high(TNoteKind)},
|
{low(TNoteKind)..high(TNoteKind)},
|
||||||
{low(TNoteKind)..high(TNoteKind)}]
|
{low(TNoteKind)..high(TNoteKind)}]
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue