summary refs log tree commit diff stats
path: root/tests/misc/tparseopt.nim
Commit message (Collapse)AuthorAgeFilesLines
* properly deprecate parseopt2 (#10452)Miran2019-01-251-28/+2
|
* fix #9629 every binary cmd line option allows on/off/empty=on (#10353)Timothee Cour2019-01-181-1/+4
| | | | | | * fix #9629 every binary cmd line option allows on/off/empty=on * workaround refs #10359
* parseopt2.cmdLineRest is now correct too (#10304)Timothee Cour2019-01-151-16/+19
|
* fix testTimothee Cour2019-01-141-2/+13
|
* fix #9842 #9951: `nim -r` and parseopt.cmdLineRest are now correctTimothee Cour2019-01-141-44/+92
|
* require errormsg to be specified before file.Arne Döring2018-12-111-1/+0
|
* fixes #9619Andreas Rumpf2018-11-091-35/+42
|
* Add ability for users to elide ':' or '=' when CLI authors pass a (#7297)c-blake2018-03-081-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add ability for users to elide ':' or '=' when CLI authors pass a non-empty partial symbol table. Behavior should be identical to the old behavior if empty partial symbol tables are passed. "Partialness" of the symbol table refers to the fact that one need only specify option keys that are toggles/booleans/do not take arguments, hence the "NoArg" suffixes in shortNoArg and longNoArg. commandLineParams() returns seq[TaintedString], so use that consistently in getopt() and initOptParser(seq[TaintedString]) dropping the taint at the quoting stage just as with the paramStr() logic. Fix capitalization inconsistency of cmdLongOption. Export OptParser.cmd and OptParser.pos so that, at least *in principle*, users of this API can handle "--" option processing termination or some "git-like" sub-command stop word with a separate option sub-syntax. { Eg., ``case p.key of "": echo "trailing non-option args: ", p.cmd[p.pos..^1]`` or ``case p.kind of cmdArgument: if p.key == "mysubcmd": ...``. } Really, searching for the last delimiter before p.pos is probably needed to frame the trailing text..Not the nicest API, but still possible with effort. * Make requested changes from string to seq[char] (see https://github.com/nim-lang/Nim/pull/7297) * Document new behavior and elaborate on some special cases. * NoArg => NoVal to be less ambiguous/more clear. * Add more documentation and an example snippet. * Tweak language. Clarify still using ':'/'=' is ok. * Add a test case for new NoVal behavior.
* fixes parseopt/parseopt2 custom cmdline args.Parashurama2017-06-061-0/+57