Skip to content

Commit 3936a34

Browse files
committed
fix compiler's and tools' use of parseopt
2 parents 02ec7ad + 1c08e30 commit 3936a34

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

compiler/nim.nim

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@ proc nimbleLockExists(config: ConfigRef): bool =
4848
return fileExists(pd.string / nimbleLock)
4949

5050
proc processCmdLine(pass: TCmdLinePass, cmd: string; config: ConfigRef) =
51-
var p = parseopt.initOptParser(cmd)
51+
var p = if cmd.len == 0: parseopt.initOptParser()
52+
else: parseopt.initOptParser(cmd)
5253
var argsCount = 0
5354

5455
config.commandLine.setLen 0

drnim/drnim.nim

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1208,7 +1208,8 @@ proc mainCommand(graph: ModuleGraph) =
12081208
genSuccessX(graph.config)
12091209

12101210
proc processCmdLine(pass: TCmdLinePass, cmd: string; config: ConfigRef) =
1211-
var p = parseopt.initOptParser(cmd)
1211+
var p = if cmd.len == 0: parseopt.initOptParser()
1212+
else: parseopt.initOptParser(cmd)
12121213
var argsCount = 1
12131214

12141215
config.commandLine.setLen 0

nimsuggest/nimsuggest.nim

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -668,7 +668,8 @@ proc mainCommand(graph: ModuleGraph) =
668668
close(results)
669669

670670
proc processCmdLine*(pass: TCmdLinePass, cmd: string; conf: ConfigRef) =
671-
var p = parseopt.initOptParser(cmd)
671+
var p = if cmd.len == 0: parseopt.initOptParser()
672+
else: parseopt.initOptParser(cmd)
672673
var findProject = false
673674
while true:
674675
parseopt.next(p)

0 commit comments

Comments
 (0)