bugfix: command line args are processed again after config files, so that --verbosity:3 works again

This commit is contained in:
Araq 2012-01-08 10:50:10 +01:00
commit f7c1bef7bb

View file

@ -23,6 +23,7 @@ var
proc ProcessCmdLine(pass: TCmdLinePass) = proc ProcessCmdLine(pass: TCmdLinePass) =
var p = parseopt.initOptParser() var p = parseopt.initOptParser()
var argsCount = 0
while true: while true:
parseopt.next(p) parseopt.next(p)
case p.kind case p.kind
@ -38,17 +39,16 @@ proc ProcessCmdLine(pass: TCmdLinePass) =
else: else:
ProcessSwitch(p.key, p.val, pass, gCmdLineInfo) ProcessSwitch(p.key, p.val, pass, gCmdLineInfo)
of cmdArgument: of cmdArgument:
if pass != passCmd1: break if argsCount == 0:
if options.command == "":
options.command = p.key options.command = p.key
else: else:
options.commandArgs.add p.key if pass == passCmd1: options.commandArgs.add p.key
if argsCount == 1:
if options.gProjectName == "":
# support UNIX style filenames anywhere for portable build scripts: # support UNIX style filenames anywhere for portable build scripts:
options.gProjectName = unixToNativePath(p.key) options.gProjectName = unixToNativePath(p.key)
arguments = cmdLineRest(p) arguments = cmdLineRest(p)
break break
inc argsCount
if pass == passCmd2: if pass == passCmd2:
if optRun notin gGlobalOptions and arguments != "": if optRun notin gGlobalOptions and arguments != "":