Error on invalid cmd line params. Params normalized. Fixes #151.
This commit is contained in:
parent
43f7e4c310
commit
c3d2e59ebc
1 changed files with 5 additions and 4 deletions
|
|
@ -89,7 +89,7 @@ Options:
|
||||||
-n, --reject Reject all interactive prompts.
|
-n, --reject Reject all interactive prompts.
|
||||||
--ver Query remote server for package version
|
--ver Query remote server for package version
|
||||||
information when searching or listing packages
|
information when searching or listing packages
|
||||||
--nimbledir dirname Set the Nimble directory.
|
--nimbleDir dirname Set the Nimble directory.
|
||||||
|
|
||||||
For more information read the Github readme:
|
For more information read the Github readme:
|
||||||
https://github.com/nim-lang/nimble#readme
|
https://github.com/nim-lang/nimble#readme
|
||||||
|
|
@ -227,15 +227,16 @@ proc parseCmdLine(): Options =
|
||||||
else:
|
else:
|
||||||
result.action.compileOptions.add("--" & key & ":" & val)
|
result.action.compileOptions.add("--" & key & ":" & val)
|
||||||
else:
|
else:
|
||||||
case key
|
case key.normalize()
|
||||||
of "help", "h": writeHelp()
|
of "help", "h": writeHelp()
|
||||||
of "version", "v": writeVersion()
|
of "version", "v": writeVersion()
|
||||||
of "accept", "y": result.forcePrompts = forcePromptYes
|
of "accept", "y": result.forcePrompts = forcePromptYes
|
||||||
of "reject", "n": result.forcePrompts = forcePromptNo
|
of "reject", "n": result.forcePrompts = forcePromptNo
|
||||||
of "ver": result.queryVersions = true
|
of "ver": result.queryVersions = true
|
||||||
of "nimbleDir": result.config.nimbleDir = val # overrides option from file
|
of "nimbledir": result.config.nimbleDir = val # overrides option from file
|
||||||
of "installed", "i": result.queryInstalled = true
|
of "installed", "i": result.queryInstalled = true
|
||||||
else: discard
|
else:
|
||||||
|
raise newException(NimbleError, "Unknown option: --" & key)
|
||||||
of cmdEnd: assert(false) # cannot happen
|
of cmdEnd: assert(false) # cannot happen
|
||||||
if result.action.typ == actionNil:
|
if result.action.typ == actionNil:
|
||||||
writeHelp()
|
writeHelp()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue