Nim/tests/misc
c-blake 551d7b7dc1 Add ability for users to elide ':' or '=' when CLI authors pass a (#7297)
* 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.
2018-03-08 08:12:34 +01:00
..
99bottles.nim Merge pull request #1075 from flaviut/inlinedocs 2014-04-09 22:56:18 +02:00
minit.nim tests: Trim .nim files trailing whitespace 2015-09-04 23:04:32 +02:00
mvarious.nim the parser finally parses 'echo {1,2}' as it should 2017-09-30 21:35:30 +02:00
parsecomb.nim big compiler refactoring; avoid globals for multi method dispatcher generation 2017-02-22 16:27:52 +01:00
t99bott.nim tests: Trim .nim files trailing whitespace 2015-09-04 23:04:32 +02:00
tack.nim tests: Trim .nim files trailing whitespace 2015-09-04 23:04:32 +02:00
tbug1217bracketquotes.nim Add test 2014-06-03 19:05:13 -04:00
tbug511622.nim Merge pull request #1075 from flaviut/inlinedocs 2014-04-09 22:56:18 +02:00
tcast.nim restrict casting for closure. (#5948); fixes #5742 2017-06-07 08:52:50 +02:00
tcharinc.nim doc updates; fixes 'inc' for 'char' 2015-03-29 13:16:22 +02:00
tcmdline.nim renamed writeln to writeLine in tests 2015-06-19 01:34:34 -05:00
tcolonisproc.nim tests: Trim .nim files trailing whitespace 2015-09-04 23:04:32 +02:00
tdllvar.nim tests: Trim .nim files trailing whitespace 2015-09-04 23:04:32 +02:00
temit.nim tests: Trim .nim files trailing whitespace 2015-09-04 23:04:32 +02:00
temptyecho.nim Merge pull request #1075 from flaviut/inlinedocs 2014-04-09 22:56:18 +02:00
tendian.nim renamed writeln to writeLine in tests 2015-06-19 01:34:34 -05:00
teventemitter.nim tests: Trim .nim files trailing whitespace 2015-09-04 23:04:32 +02:00
tevents.nim make tests green again 2017-12-15 13:24:47 +01:00
tfib.nim tests: Trim .nim files trailing whitespace 2015-09-04 23:04:32 +02:00
tfilter.nim Merge pull request #1075 from flaviut/inlinedocs 2014-04-09 22:56:18 +02:00
tgenconstraints.nim Merge pull request #1075 from flaviut/inlinedocs 2014-04-09 22:56:18 +02:00
tgetstartmilsecs.nim tests: Trim .nim files trailing whitespace 2015-09-04 23:04:32 +02:00
thallo.nim Remove expr/stmt (#5857) 2017-07-25 09:28:23 +02:00
theaproots.nim tests: Trim .nim files trailing whitespace 2015-09-04 23:04:32 +02:00
thintoff.nim tests: Trim .nim files trailing whitespace 2015-09-04 23:04:32 +02:00
tinc.nim make more tests green 2018-02-10 20:55:22 +01:00
tinit.nim tests: Trim .nim files trailing whitespace 2015-09-04 23:04:32 +02:00
tinout.nim make more tests green 2018-02-10 20:55:22 +01:00
tints.nim Remove expr/stmt (#5857) 2017-07-25 09:28:23 +02:00
tinvalidarrayaccess.nim Merge pull request #1075 from flaviut/inlinedocs 2014-04-09 22:56:18 +02:00
tinvalidnewseq.nim make more tests green 2018-02-10 20:55:22 +01:00
tissue710.nim s/procedure/routine/ in tests. 2015-06-05 14:53:49 +01:00
tlastmod.nim tests: Trim .nim files trailing whitespace 2015-09-04 23:04:32 +02:00
tlocals.nim Improved collection-to-string behavior (#6825) 2017-12-14 14:02:13 +01:00
tloops.nim tests: Trim .nim files trailing whitespace 2015-09-04 23:04:32 +02:00
tmandelbrot.nim make tests green again 2017-10-01 07:46:13 +02:00
tmemoization.nim Merge pull request #1075 from flaviut/inlinedocs 2014-04-09 22:56:18 +02:00
tmissingnilcheck.nim tests: Trim .nim files trailing whitespace 2015-09-04 23:04:32 +02:00
tnew.nim the parser finally parses 'echo {1,2}' as it should 2017-09-30 21:35:30 +02:00
tnewderef.nim tests: Trim .nim files trailing whitespace 2015-09-04 23:04:32 +02:00
tnewsets.nim tests: Trim .nim files trailing whitespace 2015-09-04 23:04:32 +02:00
tnewuns.nim tests: Trim .nim files trailing whitespace 2015-09-04 23:04:32 +02:00
tnoforward.nim Merge pull request #1075 from flaviut/inlinedocs 2014-04-09 22:56:18 +02:00
tnoinst.nim tests: Trim .nim files trailing whitespace 2015-09-04 23:04:32 +02:00
tnolen.nim make more tests green 2018-02-10 20:55:22 +01:00
tnoop.nim s/procedure/routine/ in tests. 2015-06-05 14:53:49 +01:00
tnot.nim make tests green 2016-12-18 23:32:15 +01:00
tparedef.nim tests: Trim .nim files trailing whitespace 2015-09-04 23:04:32 +02:00
tparsecombnum.nim add parser combinator test; uses multiple tuples/generics features 2015-03-07 22:15:53 +13:00
tparseopt.nim Add ability for users to elide ':' or '=' when CLI authors pass a (#7297) 2018-03-08 08:12:34 +01:00
tpos.nim tests: Trim .nim files trailing whitespace 2015-09-04 23:04:32 +02:00
tprep.nim make tests green 2014-08-31 15:15:26 +02:00
tquicksort.nim tests: Trim .nim files trailing whitespace 2015-09-04 23:04:32 +02:00
tradix.nim the parser finally parses 'echo {1,2}' as it should 2017-09-30 21:35:30 +02:00
trangechecks.nim codegen doesn't produce line tracing commands anymore; fixes #1344 2015-03-21 20:38:27 +01:00
trawstr.nim tests: Trim .nim files trailing whitespace 2015-09-04 23:04:32 +02:00
treadln.nim make tests green 2014-08-31 15:15:26 +02:00
treadx.nim make tests green again 2017-10-10 09:34:03 +02:00
tshadow_magic_type.nim Merge pull request #1075 from flaviut/inlinedocs 2014-04-09 22:56:18 +02:00
tsimplesort.nim Remove expr/stmt (#5857) 2017-07-25 09:28:23 +02:00
tsimtych.nim make more tests green 2018-02-10 20:55:22 +01:00
tsizeof.nim tests: Trim .nim files trailing whitespace 2015-09-04 23:04:32 +02:00
tslices.nim Use ^ instead of - in slices 2015-03-28 00:38:15 +01:00
tsortdev.nim tests: Trim .nim files trailing whitespace 2015-09-04 23:04:32 +02:00
tstrace.nim tests: Trim .nim files trailing whitespace 2015-09-04 23:04:32 +02:00
tstrange.nim tests: Trim .nim files trailing whitespace 2015-09-04 23:04:32 +02:00
tstrdesc.nim the parser finally parses 'echo {1,2}' as it should 2017-09-30 21:35:30 +02:00
tstrdist.nim Merge pull request #1075 from flaviut/inlinedocs 2014-04-09 22:56:18 +02:00
tunsigned64mod.nim Fix a few deprecation warnings 2016-01-25 19:10:37 +01:00
tunsignedcmp.nim fixes #3985 2018-02-10 21:20:48 +01:00
tunsignedcomp.nim cleaned up unsigned tests 2015-01-27 01:33:47 +01:00
tunsignedconv.nim Fix a few deprecation warnings 2016-01-25 19:10:37 +01:00
tunsignedinc.nim Unsigned arith corrected for JS 2016-01-21 17:00:42 +02:00
tunsignedmisc.nim Fix a few deprecation warnings 2016-01-25 19:10:37 +01:00
tupcomingfeatures.nim first implementation of package level types that allow forwarding across module boundaries 2017-10-28 15:28:59 +02:00
tvarious.nim fix #544 2015-01-02 23:58:24 +02:00
tvarious1.nim Added deques module, deprecating queues 2016-11-24 19:11:51 +07:00
tvarnums.nim make tests green again 2017-11-01 00:20:40 +01:00