summary refs log tree commit diff stats
path: root/compiler/main.nim
diff options
context:
space:
mode:
authorTimothee Cour <timothee.cour2@gmail.com>2020-01-07 15:39:07 -0800
committerAndreas Rumpf <rumpf_a@web.de>2020-01-08 00:39:07 +0100
commit15043d35b88ab0c37f7d007b09eddf1cbe85fa31 (patch)
tree6d0d1ba6a29710a95966c587a7509763d02b4adb /compiler/main.nim
parent871d5e79b1dc54c1657a1d7f85788e8bd8f4fb28 (diff)
downloadNim-15043d35b88ab0c37f7d007b09eddf1cbe85fa31.tar.gz
make SuccessX show project file + output file (#13043)
* make SuccessX show project file + output file
* address comments
* fix test and add `result.err = reNimcCrash` otherwise hard to see where reNimcCrash used
* address comments
Diffstat (limited to 'compiler/main.nim')
-rw-r--r--compiler/main.nim28
1 files changed, 18 insertions, 10 deletions
diff --git a/compiler/main.nim b/compiler/main.nim
index 7a78c66ba..700870241 100644
--- a/compiler/main.nim
+++ b/compiler/main.nim
@@ -355,16 +355,24 @@ proc mainCommand*(graph: ModuleGraph) =
 
   if conf.errorCounter == 0 and
      conf.cmd notin {cmdInterpret, cmdRun, cmdDump}:
-    when declared(system.getMaxMem):
-      let usedMem = formatSize(getMaxMem()) & " peakmem"
-    else:
-      let usedMem = formatSize(getTotalMem())
-    rawMessage(conf, hintSuccessX, [$conf.linesCompiled,
-               formatFloat(epochTime() - conf.lastCmdTime, ffDecimal, 3),
-               usedMem,
-               if isDefined(conf, "danger"): "Dangerous Release Build"
-               elif isDefined(conf, "release"): "Release Build"
-               else: "Debug Build"])
+    let mem =
+      when declared(system.getMaxMem): formatSize(getMaxMem()) & " peakmem"
+      else: formatSize(getTotalMem()) & " totmem"
+    let loc = $conf.linesCompiled
+    let build = if isDefined(conf, "danger"): "Dangerous Release"
+                elif isDefined(conf, "release"): "Release"
+                else: "Debug"
+    let sec = formatFloat(epochTime() - conf.lastCmdTime, ffDecimal, 3)
+    let project = if optListFullPaths in conf.globalOptions: $conf.projectFull else: $conf.projectName
+    let output = if optListFullPaths in conf.globalOptions: $conf.getOutFileFull else: $conf.outFile
+    rawMessage(conf, hintSuccessX, [
+      "loc", loc,
+      "sec", sec,
+      "mem", mem,
+      "build", build,
+      "project", project,
+      "output", output,
+      ])
 
   when PrintRopeCacheStats:
     echo "rope cache stats: "