summary refs log tree commit diff stats
path: root/tools
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2020-10-11 12:11:47 +0200
committerAndreas Rumpf <rumpf_a@web.de>2020-10-11 20:44:04 +0200
commit3492178494484e0c0c1d8eec83aadc5b2ad06ede (patch)
tree7db5bb72a42269b8d15473320dcef3531a564c88 /tools
parentc2c7f6025922034073418e608a62f8f4d5a5b381 (diff)
downloadNim-3492178494484e0c0c1d8eec83aadc5b2ad06ede.tar.gz
refactoring: removed cmdlinehelper.mainCommand callback
Diffstat (limited to 'tools')
-rw-r--r--tools/nimfind.nim7
1 files changed, 4 insertions, 3 deletions
diff --git a/tools/nimfind.nim b/tools/nimfind.nim
index 4ad5fbb4f..f13e86aaa 100644
--- a/tools/nimfind.nim
+++ b/tools/nimfind.nim
@@ -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())