Fix compile-time message includes when installing via Nimble.

This commit is contained in:
2022-01-21 13:26:22 -06:00
parent 71e035fdbe
commit 6226ff21c5
6 changed files with 168 additions and 13 deletions

View File

@@ -7,10 +7,9 @@ import algorithm, cliutils, data_uri, docopt, json, logging, options, os,
from nre import re
import strutils except alignLeft, capitalize, strip, toUpper, toLower
import pitpkg/private/libpit
import pitpkg/cliconstants
export libpit
include "pitpkg/version.nim"
type
CliContext = ref object
cfg*: PitConfig
@@ -267,8 +266,6 @@ proc list(
when isMainModule:
try:
const usage = readFile("src/usage.txt")
const onlineHelp = readFile("src/online-help.txt")
let consoleLogger = newConsoleLogger(
levelThreshold=lvlInfo,
@@ -276,7 +273,7 @@ when isMainModule:
logging.addHandler(consoleLogger)
# Parse arguments
let args = docopt(usage, version = PIT_VERSION)
let args = docopt(USAGE, version = PIT_VERSION)
if args["--debug"]:
consoleLogger.levelThreshold = lvlDebug
@@ -284,8 +281,8 @@ when isMainModule:
if args["--echo-args"]: stderr.writeLine($args)
if args["help"]:
stderr.writeLine(usage & "\n")
stderr.writeLine(onlineHelp)
stderr.writeLine(USAGE & "\n")
stderr.writeLine(ONLINE_HELP)
quit()
let ctx = initContext(args)