Commit Graph

12 Commits

Author SHA1 Message Date
flywind
c5f64f101b fix #13086 (#14987)
* fix #6608

* minor

* fix

* clean tests

* make testamnet happy

* again

* minor

* fix #13086
2020-07-15 03:46:17 -04:00
Timothee Cour
e909486e5c trunner was not actually being tested in non-CTFFI mode; minor testament cleanups (#14377)
* use check
* trunner now works with cpp
* cleanup: move compiler/unittest_light => stdtest/unittest_light
* fix tests/readme.md
* remove deadcode references to rodfiles
* fix for windows
2020-05-19 09:41:31 +02:00
Jasper Jenkins
6b23b2d7df parseopt fix (#11363) [backport] 2019-06-01 10:44:08 +02:00
Miran
268197add8 properly deprecate parseopt2 (#10452) 2019-01-25 13:13:55 +01:00
Timothee Cour
27e2ed4375 fix #9629 every binary cmd line option allows on/off/empty=on (#10353)
* fix #9629 every binary cmd line option allows on/off/empty=on

* workaround refs #10359
2019-01-18 09:03:26 +01:00
Timothee Cour
795e5e11ef parseopt2.cmdLineRest is now correct too (#10304) 2019-01-15 21:51:02 +01:00
Timothee Cour
9e68b2ce5d fix test 2019-01-14 17:00:54 -08:00
Timothee Cour
0a8762eb7b fix #9842 #9951: nim -r and parseopt.cmdLineRest are now correct 2019-01-14 17:00:54 -08:00
Arne Döring
1105d03644 require errormsg to be specified before file. 2018-12-11 21:23:21 +01:00
Andreas Rumpf
c0fc2f5726 fixes #9619 2018-11-09 09:03:28 +01:00
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
Parashurama
27e2a34340 fixes parseopt/parseopt2 custom cmdline args. 2017-06-06 13:50:26 +02:00