Skip to content

Commit

Permalink
./koch --nonexistant now fails (nim-lang#18036)
Browse files Browse the repository at this point in the history
  • Loading branch information
timotheecour authored and PMunch committed Mar 28, 2022
1 parent a6f6963 commit 258735f
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions koch.nim
Original file line number Diff line number Diff line change
Expand Up @@ -634,9 +634,9 @@ proc valgrind(cmd: string) =
let supp = getAppDir() / "tools" / "nimgrind.supp"
exec("valgrind --suppressions=" & supp & valcmd)

proc showHelp() =
proc showHelp(success: bool) =
quit(HelpText % [VersionAsString & spaces(44-len(VersionAsString)),
CompileDate, CompileTime], QuitSuccess)
CompileDate, CompileTime], if success: QuitSuccess else: QuitFailure)

proc branchDone() =
let thisBranch = execProcess("git symbolic-ref --short HEAD").strip()
Expand All @@ -656,14 +656,15 @@ when isMainModule:
case op.kind
of cmdLongOption, cmdShortOption:
case normalize(op.key)
of "help", "h": showHelp(success = true)
of "latest": latest = true
of "stable": latest = false
of "nim": nimExe = op.val.absolutePath # absolute so still works with changeDir
of "localdocs":
localDocsOnly = true
if op.val.len > 0:
localDocsOut = op.val.absolutePath
else: showHelp()
else: showHelp(success = false)
of cmdArgument:
case normalize(op.key)
of "boot": boot(op.cmdLineRest)
Expand Down Expand Up @@ -705,6 +706,6 @@ when isMainModule:
exec("nimble install -y fusion@$#" % suffix)
of "ic": icTest(op.cmdLineRest)
of "branchdone": branchDone()
else: showHelp()
else: showHelp(success = false)
break
of cmdEnd: break

0 comments on commit 258735f

Please sign in to comment.