diff options
author | Andreas Rumpf <rumpf_a@web.de> | 2020-10-11 12:11:47 +0200 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2020-10-11 20:44:04 +0200 |
commit | 3492178494484e0c0c1d8eec83aadc5b2ad06ede (patch) | |
tree | 7db5bb72a42269b8d15473320dcef3531a564c88 /drnim | |
parent | c2c7f6025922034073418e608a62f8f4d5a5b381 (diff) | |
download | Nim-3492178494484e0c0c1d8eec83aadc5b2ad06ede.tar.gz |
refactoring: removed cmdlinehelper.mainCommand callback
Diffstat (limited to 'drnim')
-rw-r--r-- | drnim/drnim.nim | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/drnim/drnim.nim b/drnim/drnim.nim index e17667ec7..b4761a398 100644 --- a/drnim/drnim.nim +++ b/drnim/drnim.nim @@ -1209,15 +1209,13 @@ proc mainCommand(graph: ModuleGraph) = else: "Debug" let sec = formatFloat(epochTime() - conf.lastCmdTime, ffDecimal, 3) let project = if optListFullPaths in conf.globalOptions: $conf.projectFull else: $conf.projectName - var output = $conf.absOutFile - if optListFullPaths notin conf.globalOptions: output = output.AbsoluteFile.extractFilename rawMessage(conf, hintSuccessX, [ "loc", loc, "sec", sec, "mem", mem, "build", build, "project", project, - "output", output, + "output", "" ]) proc processCmdLine(pass: TCmdLinePass, cmd: string; config: ConfigRef) = @@ -1262,8 +1260,7 @@ proc handleCmdLine(cache: IdentCache; conf: ConfigRef) = incl conf.options, optStaticBoundsCheck let self = NimProg( supportsStdinFile: true, - processCmdLine: processCmdLine, - mainCommand: mainCommand + processCmdLine: processCmdLine ) self.initDefinesProg(conf, "drnim") if paramCount() == 0: @@ -1271,7 +1268,9 @@ proc handleCmdLine(cache: IdentCache; conf: ConfigRef) = return self.processCmdLineAndProjectPath(conf) - if not self.loadConfigsAndRunMainCommand(cache, conf): return + var graph = newModuleGraph(cache, conf) + if not self.loadConfigsAndRunMainCommand(cache, conf, graph): return + mainCommand(graph) if conf.hasHint(hintGCStats): echo(GC_getStatistics()) when compileOption("gc", "v2") or compileOption("gc", "refc"): |