Commit Graph

53 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
Dominik Picheta
bab5351d43 Fixes ambiguity errors when evaluating Nimble files. (#12674) [backport]
When trying to evaluate a Nimble file which imports a Nim module
I was getting the following errors for some reason:

```
/Users/dom/projects/nim/lib/pure/parseopt.nim(229, 46) Error: ambiguous call; both system.paramCount() [declared in /Users/dom/projects/nim/lib/system/nimscript.nim(65, 6)] and os.paramCount() [declared in /Users/dom/projects/nim/lib/pure/os.nim(2613, 8)] match for: ()
```
2019-11-18 09:26:06 +01:00
narimiran
cc3e9ca164 remove unused imports 2019-11-06 12:01:00 +01:00
narimiran
b17ed2ca9c [backport] run nimpretty on parsers 2019-09-30 13:58:08 +02:00
Timothee Cour
64168d4aea fixes #8405: -d:useNimRtl now works even when {.rtl.} procs are used at compile time; CTFFI now works with {dynlib} (#11635) 2019-07-03 23:57:52 +02:00
Araq
284a8cb58a nimpretty: bugfix [bugfix] 2019-06-28 11:45:21 +02:00
Jasper Jenkins
6b23b2d7df parseopt fix (#11363) [backport] 2019-06-01 10:44:08 +02:00
Araq
cacd6d1070 fixes #11294 2019-05-24 09:43:04 +02:00
Jjp137
a6a014a859 better docs: parseopt (#10398) 2019-01-22 14:52:43 +01:00
Timothee Cour
0a8762eb7b fix #9842 #9951: nim -r and parseopt.cmdLineRest are now correct 2019-01-14 17:00:54 -08:00
Araq
9526009e0e fixes #9120 2018-12-16 20:34:07 +01:00
Araq
3ba8f158fb added parseopt.remainingArgs; refs #9951 2018-12-14 11:41:19 +01:00
Andreas Rumpf
130c218ff9 parseopt: remove confusing dead code 2018-11-09 09:03:28 +01:00
Andreas Rumpf
c0fc2f5726 fixes #9619 2018-11-09 09:03:28 +01:00
Andreas Rumpf
36473acf47 fixes a parseopt regression (#8820) 2018-08-30 23:50:09 +02:00
Araq
a42150f9a8 make parseopt work with DLLs on Unix 2018-08-28 15:41:55 +02:00
Araq
e02e057a70 make parsopt compile under --taintMode:on 2018-08-28 15:41:55 +02:00
Araq
6f16166c60 parseopt: keep the seq of arguments as given; fixes various command line parsing edge cases; refs #6818 2018-08-28 15:41:55 +02:00
Araq
bbb0fd4eb7 remove deprecated stuff from the stdlib; introduce better deprecation warnings 2018-05-05 21:45:07 +02:00
Andreas Rumpf
203d833688 parseopt stdlib module: dont rely on the zero terminator 2018-04-29 01:31:29 +02: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
Andreas Rumpf
a6c7972086 make travis green again 2018-03-01 16:23:25 +01:00
Araq
ce1047f2ae added -d:nimNoArrayToString define to allow easier porting to 0.18 2018-03-01 09:42:25 +01:00
Parashurama
27e2a34340 fixes parseopt/parseopt2 custom cmdline args. 2017-06-06 13:50:26 +02:00
Araq
e0f896785d docs now build again 2015-10-12 20:58:46 +02:00
Adam Strzelecki
144dc8f8ad Move deprecated modules into lib/deprecated/
This gives clear indication what modules are now deprecated and reduce clutter
in non-deprecated module directories.
2015-09-30 12:26:25 +02:00
Araq
30829ffec4 fixes #2874 2015-07-01 16:44:16 +02:00
pdw
d18e18060e lib/pure/p-t - Dropped 'T' from types 2015-06-04 13:18:36 +02:00
Araq
21ccc5d58e parseopt is not deprecated anymore 2015-03-03 13:53:31 +01:00
Guillaume Gelin
3119fe087d Happy new year! 2015-01-06 15:26:33 +01:00
Araq
63c9c2877e updated nimgrep tool 2014-09-10 22:27:07 +02:00
Araq
4523b29d7a Nimrod renamed to Nim 2014-08-28 09:59:26 +02:00
Araq
bf9764e563 several modules changed 2014-08-28 02:21:49 +02:00
Araq
11b6958755 big rename 2014-08-27 23:42:51 +02:00
Araq
2f43fdb837 renamefest 2014-08-23 01:43:49 +02:00
Araq
dd806cafa0 distinguish between 'defined' and 'declared' 2014-08-11 20:38:28 +02:00
Grzegorz Adam Hankiewicz
74f94482cc Adds parseopt2 module to documentation index. 2014-01-15 22:23:20 +01:00
Araq
b731e6ef1c case consistency: cs:partial bootstraps on windows 2013-12-29 03:19:10 +01:00
Araq
438703f59e case consistency: next steps 2013-12-29 01:13:51 +01:00
Araq
92b8fac94a case consistency part 4 2013-12-27 23:10:36 +01:00
Michał Zieliński
2e0da6a5c6 Make old parseopt as deprecated. 2013-12-10 20:41:52 +01:00
Grzegorz Adam Hankiewicz
72a3e21f28 Removes executable bit for text files. 2013-03-16 23:53:07 +01:00
Araq
4f1b89c30c year 2012 for most copyright headers 2012-01-02 23:07:35 +01:00
Araq
485c371942 renamed optional to discardable 2011-09-24 19:18:08 +02:00
Araq
6023e994fb beginning of a taint mode; type system enhancements 2011-09-24 00:46:41 +02:00
Araq
569c1ce5ec bugfix: proper cache for generic instantiations 2011-07-21 00:57:39 +02:00
Araq
3e9dcc8be5 deprecated system.copy: use system.substr instead 2011-05-14 01:13:44 +02:00
Andreas Rumpf
8098e2a421 inlining of the write barrier for dlls 2010-08-08 22:45:21 +02:00
Andreas Rumpf
40ea1d0330 fixed pango/pangoutils new wrappers 2010-02-26 01:26:16 +01:00
rumpf_a@web.de
40a5d6c3b9 continued work on html/xmlparser 2010-02-14 00:29:35 +01:00