refactoring: removed cmdlinehelper.mainCommand callback

This commit is contained in:
Andreas Rumpf 2020-10-11 12:11:47 +02:00
commit 3492178494
5 changed files with 32 additions and 32 deletions

View file

@ -208,8 +208,7 @@ proc processCmdLine*(pass: TCmdLinePass, cmd: string; conf: ConfigRef) =
proc handleCmdLine(cache: IdentCache; conf: ConfigRef) =
let self = NimProg(
suggestMode: true,
processCmdLine: processCmdLine,
mainCommand: mainCommand
processCmdLine: processCmdLine
)
self.initDefinesProg(conf, "nimfind")
@ -228,6 +227,8 @@ proc handleCmdLine(cache: IdentCache; conf: ConfigRef) =
if not dirExists(conf.prefixDir / RelativeDir"lib"):
conf.prefixDir = AbsoluteDir""
discard self.loadConfigsAndRunMainCommand(cache, conf)
var graph = newModuleGraph(cache, conf)
if self.loadConfigsAndRunMainCommand(cache, conf, graph):
mainCommand(graph)
handleCmdLine(newIdentCache(), newConfigRef())