fixes #11294
This commit is contained in:
parent
39a3dbb16b
commit
cacd6d1070
2 changed files with 7 additions and 4 deletions
|
|
@ -106,7 +106,7 @@ proc writeCommandLineUsage*(conf: ConfigRef) =
|
||||||
msgWriteln(conf, getCommandLineDesc(conf), {msgStdout})
|
msgWriteln(conf, getCommandLineDesc(conf), {msgStdout})
|
||||||
|
|
||||||
proc addPrefix(switch: string): string =
|
proc addPrefix(switch: string): string =
|
||||||
if len(switch) == 1: result = "-" & switch
|
if len(switch) <= 1: result = "-" & switch
|
||||||
else: result = "--" & switch
|
else: result = "--" & switch
|
||||||
|
|
||||||
const
|
const
|
||||||
|
|
@ -770,6 +770,8 @@ proc processSwitch*(switch, arg: string, pass: TCmdLinePass, info: TLineInfo;
|
||||||
processOnOffSwitchG(conf, {optDocInternal}, arg, pass, info)
|
processOnOffSwitchG(conf, {optDocInternal}, arg, pass, info)
|
||||||
of "multimethods":
|
of "multimethods":
|
||||||
processOnOffSwitchG(conf, {optMultiMethods}, arg, pass, info)
|
processOnOffSwitchG(conf, {optMultiMethods}, arg, pass, info)
|
||||||
|
of "":
|
||||||
|
conf.projectName = "-"
|
||||||
else:
|
else:
|
||||||
if strutils.find(switch, '.') >= 0: options.setConfigVar(conf, switch, arg)
|
if strutils.find(switch, '.') >= 0: options.setConfigVar(conf, switch, arg)
|
||||||
else: invalidCmdLineOption(conf, pass, switch, info)
|
else: invalidCmdLineOption(conf, pass, switch, info)
|
||||||
|
|
|
||||||
|
|
@ -274,6 +274,7 @@ when declared(os.paramCount):
|
||||||
proc handleShortOption(p: var OptParser; cmd: string) =
|
proc handleShortOption(p: var OptParser; cmd: string) =
|
||||||
var i = p.pos
|
var i = p.pos
|
||||||
p.kind = cmdShortOption
|
p.kind = cmdShortOption
|
||||||
|
if i < cmd.len:
|
||||||
add(p.key.string, cmd[i])
|
add(p.key.string, cmd[i])
|
||||||
inc(i)
|
inc(i)
|
||||||
p.inShortState = true
|
p.inShortState = true
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue