Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions compiler/cmdlinehelper.nim
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@ type
NimProg* = ref object
suggestMode*: bool
supportsStdinFile*: bool
processCmdLine*: proc(pass: TCmdLinePass, cmd: string; config: ConfigRef)
processCmdLine*: proc(pass: TCmdLinePass; config: ConfigRef)

proc initDefinesProg*(self: NimProg, conf: ConfigRef, name: string) =
condsyms.initDefines(conf.symbols)
defineSymbol conf.symbols, name

proc processCmdLineAndProjectPath*(self: NimProg, conf: ConfigRef) =
self.processCmdLine(passCmd1, "", conf)
self.processCmdLine(passCmd1, conf)
if conf.projectIsCmd and conf.projectName in ["-", ""]:
handleCmdInput(conf)
elif self.supportsStdinFile and conf.projectName == "-":
Expand Down Expand Up @@ -73,7 +73,7 @@ proc loadConfigsAndProcessCmdLine*(self: NimProg, cache: IdentCache; conf: Confi
# command line can overwrite the config file's settings
if conf.backend != backendJs: # bug #19059
extccomp.initVars(conf)
self.processCmdLine(passCmd2, "", conf)
self.processCmdLine(passCmd2, conf)
if conf.cmd == cmdNone:
rawMessage(conf, errGenerated, "command missing")

Expand Down
4 changes: 2 additions & 2 deletions compiler/nim.nim
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ proc nimbleLockExists(config: ConfigRef): bool =
return true
return fileExists(pd.string / nimbleLock)

proc processCmdLine(pass: TCmdLinePass, cmd: string; config: ConfigRef) =
var p = parseopt.initOptParser(cmd)
proc processCmdLine(pass: TCmdLinePass; config: ConfigRef) =
var p = parseopt.initOptParser()
var argsCount = 0

config.commandLine.setLen 0
Expand Down
4 changes: 2 additions & 2 deletions drnim/drnim.nim
Original file line number Diff line number Diff line change
Expand Up @@ -1207,8 +1207,8 @@ proc mainCommand(graph: ModuleGraph) =
if conf.errorCounter == 0:
genSuccessX(graph.config)

proc processCmdLine(pass: TCmdLinePass, cmd: string; config: ConfigRef) =
var p = parseopt.initOptParser(cmd)
proc processCmdLine(pass: TCmdLinePass; config: ConfigRef) =
var p = parseopt.initOptParser()
var argsCount = 1

config.commandLine.setLen 0
Expand Down
6 changes: 3 additions & 3 deletions nimsuggest/nimsuggest.nim
Original file line number Diff line number Diff line change
Expand Up @@ -667,8 +667,8 @@ proc mainCommand(graph: ModuleGraph) =
close(requests)
close(results)

proc processCmdLine*(pass: TCmdLinePass, cmd: string; conf: ConfigRef) =
var p = parseopt.initOptParser(cmd)
proc processCmdLine*(pass: TCmdLinePass; conf: ConfigRef) =
var p = parseopt.initOptParser()
var findProject = false
while true:
parseopt.next(p)
Expand Down Expand Up @@ -1334,7 +1334,7 @@ else:
compileProject(graph)


proc mockCmdLine(pass: TCmdLinePass, cmd: string; conf: ConfigRef) =
proc mockCmdLine(pass: TCmdLinePass; conf: ConfigRef) =
conf.suggestVersion = 0
let a = unixToNativePath(project)
if dirExists(a) and not fileExists(a.addFileExt("nim")):
Expand Down
Loading