summary refs log tree commit diff stats
path: root/compiler/nimrod.nim
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2011-11-30 19:51:51 +0100
committerAraq <rumpf_a@web.de>2011-11-30 19:51:51 +0100
commitab5621a62bc670c0d1647df6322f70f26f054e8e (patch)
treeb6f42b73ee1fd9e6ff69dedb2a839af0da9e4332 /compiler/nimrod.nim
parent7d2466638e5170946e862f0beaddcece93c05fe7 (diff)
downloadNim-ab5621a62bc670c0d1647df6322f70f26f054e8e.tar.gz
bugfix: don't process arguments that are to be passed to the produced exe
Diffstat (limited to 'compiler/nimrod.nim')
-rwxr-xr-xcompiler/nimrod.nim21
1 files changed, 11 insertions, 10 deletions
diff --git a/compiler/nimrod.nim b/compiler/nimrod.nim
index 97e017e4f..6a9ae690e 100755
--- a/compiler/nimrod.nim
+++ b/compiler/nimrod.nim
@@ -37,17 +37,18 @@ proc ProcessCmdLine(pass: TCmdLinePass) =
         ProcessSwitch(key, val, pass, gCmdLineInfo)
       else: 
         ProcessSwitch(p.key, p.val, pass, gCmdLineInfo)
-    of cmdArgument: 
-      if pass == passCmd1:
-        if options.command == "":
-          options.command = p.key
-        else:
-          options.commandArgs.add p.key
+    of cmdArgument:
+      if pass != passCmd1: break
+      if options.command == "":
+        options.command = p.key
+      else:
+        options.commandArgs.add p.key
 
-          if options.gProjectName == "":
-            # support UNIX style filenames anywhere for portable build scripts:
-            options.gProjectName = unixToNativePath(p.key)
-            arguments = cmdLineRest(p)
+        if options.gProjectName == "":
+          # support UNIX style filenames anywhere for portable build scripts:
+          options.gProjectName = unixToNativePath(p.key)
+          arguments = cmdLineRest(p)
+          break
           
   if pass == passCmd2:
     if optRun notin gGlobalOptions and arguments != "":