./koch --nonexistant now fails (#18036)
This commit is contained in:
parent
e904c6d87c
commit
8be5344b3b
1 changed files with 5 additions and 4 deletions
9
koch.nim
9
koch.nim
|
|
@ -634,9 +634,9 @@ proc valgrind(cmd: string) =
|
||||||
let supp = getAppDir() / "tools" / "nimgrind.supp"
|
let supp = getAppDir() / "tools" / "nimgrind.supp"
|
||||||
exec("valgrind --suppressions=" & supp & valcmd)
|
exec("valgrind --suppressions=" & supp & valcmd)
|
||||||
|
|
||||||
proc showHelp() =
|
proc showHelp(success: bool) =
|
||||||
quit(HelpText % [VersionAsString & spaces(44-len(VersionAsString)),
|
quit(HelpText % [VersionAsString & spaces(44-len(VersionAsString)),
|
||||||
CompileDate, CompileTime], QuitSuccess)
|
CompileDate, CompileTime], if success: QuitSuccess else: QuitFailure)
|
||||||
|
|
||||||
proc branchDone() =
|
proc branchDone() =
|
||||||
let thisBranch = execProcess("git symbolic-ref --short HEAD").strip()
|
let thisBranch = execProcess("git symbolic-ref --short HEAD").strip()
|
||||||
|
|
@ -656,6 +656,7 @@ when isMainModule:
|
||||||
case op.kind
|
case op.kind
|
||||||
of cmdLongOption, cmdShortOption:
|
of cmdLongOption, cmdShortOption:
|
||||||
case normalize(op.key)
|
case normalize(op.key)
|
||||||
|
of "help", "h": showHelp(success = true)
|
||||||
of "latest": latest = true
|
of "latest": latest = true
|
||||||
of "stable": latest = false
|
of "stable": latest = false
|
||||||
of "nim": nimExe = op.val.absolutePath # absolute so still works with changeDir
|
of "nim": nimExe = op.val.absolutePath # absolute so still works with changeDir
|
||||||
|
|
@ -663,7 +664,7 @@ when isMainModule:
|
||||||
localDocsOnly = true
|
localDocsOnly = true
|
||||||
if op.val.len > 0:
|
if op.val.len > 0:
|
||||||
localDocsOut = op.val.absolutePath
|
localDocsOut = op.val.absolutePath
|
||||||
else: showHelp()
|
else: showHelp(success = false)
|
||||||
of cmdArgument:
|
of cmdArgument:
|
||||||
case normalize(op.key)
|
case normalize(op.key)
|
||||||
of "boot": boot(op.cmdLineRest)
|
of "boot": boot(op.cmdLineRest)
|
||||||
|
|
@ -705,6 +706,6 @@ when isMainModule:
|
||||||
exec("nimble install -y fusion@$#" % suffix)
|
exec("nimble install -y fusion@$#" % suffix)
|
||||||
of "ic": icTest(op.cmdLineRest)
|
of "ic": icTest(op.cmdLineRest)
|
||||||
of "branchdone": branchDone()
|
of "branchdone": branchDone()
|
||||||
else: showHelp()
|
else: showHelp(success = false)
|
||||||
break
|
break
|
||||||
of cmdEnd: break
|
of cmdEnd: break
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue