Nim/lib/pure
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
..
collections more documentation fixes 2018-03-05 23:25:50 +01:00
concurrency Fallback to doNothing if /proc/loadavg cant be opened (#7123) 2018-01-22 13:52:22 +01:00
includes Fixes #4995. (#7157) 2018-02-13 11:08:37 +01:00
ioselects Merge branch 'devel' into async-improvements 2018-01-17 16:28:00 +00:00
unidecode lib: Trim .nim files trailing whitespace 2015-09-04 23:03:56 +02:00
algorithm.nim algorithm.nim: change formatting to Nim's defaults 2018-03-05 13:20:50 +01:00
async.nim Unify async macro and futures for js and native targets 2018-01-05 16:40:51 +02:00
asyncdispatch.nim Allow float argument to sleepAsync() to allow sub-millisecond resolution 2018-02-23 19:16:11 +01:00
asyncdispatch.nim.cfg
asyncfile.nim Fix AsyncFile open flags. Fixes #5531 2018-02-17 17:40:35 +07:00
asyncftpclient.nim Merge branch 'asyncftp-add-removeDir' of https://github.com/pyloor/Nim into pyloor-asyncftp-add-removeDir 2016-09-25 13:11:02 +02:00
asyncfutures.nim Merge branch 'devel' into async-improvements 2018-01-17 16:28:00 +00:00
asynchttpserver.nim Don't catch-all in asynchttpserver. It hides bugs. 2017-11-26 16:40:24 +00:00
asyncmacro.nim Merge pull request #6962 from nim-lang/fixes/6100 2018-01-10 23:11:26 +00:00
asyncnet.nim Fixes #4995. (#7157) 2018-02-13 11:08:37 +01:00
asyncstreams.nim split FutureStream from asyncfutures 2017-07-05 12:54:09 +02:00
base64.nim Small base64.nim refactor (#5755) 2017-04-25 20:47:26 +02:00
bitops.nim bitops: add 'hamming weight' to the doc index 2017-12-03 15:20:50 +01:00
browsers.nim Don't run "kde-open" and "gnome-open" under Unix (#6426) 2017-11-19 03:29:26 +01:00
cgi.nim Moved encodeUrl and decodeUrl from cgi to url 2017-11-25 16:55:10 +01:00
colors.nim Remove expr/stmt (#5857) 2017-07-25 09:28:23 +02:00
complex.nim lib: Trim .nim files trailing whitespace 2015-09-04 23:03:56 +02:00
cookies.nim Better times module (#6552) 2017-12-18 23:11:28 +01:00
coro.nim Fix waiting on coroutines (#5463) 2017-03-02 14:53:50 +01:00
coro.nimcfg fix test failure in coro.nim 2015-10-01 12:05:45 -07:00
cstrutils.nim added new stdlib module 'cstrutils' for easier cstring handling 2017-12-18 13:16:29 +01:00
db_common.nim Fixes docgen for lib/pure/db_common.nim. 2016-01-05 15:56:13 +00:00
distros.nim Fix for issue #5736. (#6061) 2017-07-07 08:10:39 +02:00
dynlib.nim Fixed dynlink with OpenSSL >1.1.0. Added loadLibPattern. 2016-11-30 17:16:54 +02:00
encodings.nim Fix iconv import on freebsd and netbsd (#5490) 2017-03-07 09:56:16 +01:00
endians.nim optimize byte-swapping in endians.nim 2017-01-05 15:13:57 +01:00
events.nim makes tests green 2016-01-15 14:44:54 +01:00
fenv.nim
future.nim Move asArray macro back to sequtils 2017-11-18 14:18:00 +01:00
hashes.nim fixes #5969 2017-06-09 13:39:42 +02:00
htmlgen.nim Fixes #4377. 2017-11-28 21:55:29 +01:00
htmlparser.nim Changes entityToUtf8 implementation from htmlparser and add two procs (#7288) 2018-03-04 21:18:03 +01:00
httpclient.nim Improve SSL error message in httpclient. 2018-02-22 10:49:27 +00:00
httpcore.nim Add $ for HttpHeaders. 2017-10-20 18:24:17 +01:00
httpserver.nim Added missing modules to lib.txt and warnings to some module's docs. 2016-01-18 15:33:39 +00:00
json.nim Fix json.to for types with generic parameters 2018-02-11 23:15:04 +01:00
lenientops.nim Added 'lenient ops' module (#6754) 2017-11-21 13:22:27 +01:00
lexbase.nim beginnings of the new nimpretty tool; still unusable 2017-10-05 08:43:22 +02:00
logging.nim logging: don't crash on nil strings 2018-01-11 11:50:13 +02:00
marshal.nim more replacements for the deprecated '<' 2017-10-29 08:55:30 +01:00
matchers.nim fixes #6631 2017-10-30 14:45:57 +01:00
math.nim fixes #6353 (#6951) 2017-12-21 16:32:26 +01:00
md5.nim prepared stdlb for new integer arithmetic rules 2017-09-16 10:57:21 +02:00
memfiles.nim memfiles: better error checking for Windows; refs #6361 2018-01-03 13:24:20 +01:00
mersenne.nim make countup et al take only a single type parameter in order to prevent type guesses 2017-11-02 19:02:08 +01:00
mimetypes.nim mimetypes improvement: make mimetypes easier to use by allowing the extension to start with a dot which is what splitFile().ext returns 2017-11-28 17:34:30 +01:00
nativesockets.nim Fixes #4995. (#7157) 2018-02-13 11:08:37 +01:00
net.nim Detect openssl related to outdated openssl and help user solve issue. 2018-02-25 13:34:32 +00:00
nimprof.nim Enable embedded profiler to display filenames. 2016-08-02 19:19:31 +07:00
nimprof.nim.cfg
nimtracker.nim make memory tracker work without onThreadCreation 2017-03-14 15:45:35 +01:00
oids.nim Better times module (#6552) 2017-12-18 23:11:28 +01:00
options.nim Fix documentation for the $ proc on an option (#6449) 2017-10-02 16:11:53 +02:00
os.nim fixes #6939 2018-02-02 17:35:04 +01:00
ospaths.nim Fixed ospaths compilation on js (#6826) 2017-11-28 01:52:49 +01:00
osproc.nim make osproc.execProcesses more robust 2018-02-25 16:02:52 +01:00
oswalkdir.nim Add copyright header 2016-07-21 08:53:10 +01:00
parsecfg.nim fixes #6046 parsecfg failed to parse negative int (#6097) 2017-07-14 16:28:39 +02:00
parsecsv.nim Parsecsv mutability (#7253) 2018-02-24 14:55:38 +01:00
parseopt.nim Add ability for users to elide ':' or '=' when CLI authors pass a (#7297) 2018-03-08 08:12:34 +01:00
parseopt2.nim deprecate parseopt2 stdlib module 2018-02-28 23:00:52 +01:00
parsesql.nim fix 2017-12-14 18:36:18 +00:00
parseutils.nim Add a more number parsers to the scanf macro (#6985) 2018-01-05 17:36:56 +01:00
parsexml.nim htmlparser: support parsing of class=foobar without quotes 2016-11-05 15:27:47 +01:00
pegs.nim Remove expr/stmt (#5857) 2017-07-25 09:28:23 +02:00
punycode.nim Add copyright header 2016-07-21 08:52:39 +01:00
random.nim Fixed crash in rand (#7103) 2018-01-18 18:47:58 +01:00
rationals.nim Use safe limit for toRational(float, int) (#7021) 2018-01-03 12:41:10 +01:00
ropes.nim fixes ropes.nim regression; make tests green again 2017-11-06 19:25:28 +01:00
scgi.nim added a warning that the .deprecate statement is unreliable for routines 2017-11-21 11:27:35 +01:00
securehash.nim move new sha1 module into the new 'std' namespace 2018-02-06 17:40:31 +01:00
segfaults.nim fixes #5599 (#5610) 2017-03-26 09:30:59 +02:00
selectors.nim Fixes #4995. (#7157) 2018-02-13 11:08:37 +01:00
smtp.nim SMTP sync/async deduplication 2017-03-07 12:10:18 -06:00
smtp.nim.cfg
stats.nim stats.nim: add a '$' operator for RunningStat 2018-01-18 10:45:46 +01:00
streams.nim Resolves #5588: adds openFileStream proc that throws on failure (#7282) 2018-03-04 17:30:28 +01:00
strformat.nim Improves documentation for strformat module. 2018-03-01 19:07:58 +00:00
strmisc.nim moved expandTabs to strmisc 2016-06-15 17:15:27 +02:00
strscans.nim strscans: fix the type checking logic; improve the documentation 2018-01-06 17:27:19 +01:00
strtabs.nim Revert "Fixes #4265." 2018-02-17 22:24:43 +00:00
strutils.nim strutils.strip: improve the documentation; fixes #7159 2018-03-05 21:45:13 +01:00
subexes.nim Remove expr/stmt (#5857) 2017-07-25 09:28:23 +02:00
terminal.nim move readPasswordFromStdin from rdstdin to terminal (#7266) 2018-02-27 17:49:35 +01:00
times.nim Remove repetitive index checks in b30b920751. 2018-02-19 20:00:14 +00:00
typetraits.nim Trim remaining expr/stmt from stdlib (#6742) 2017-11-15 17:34:48 +01:00
unicode.nim Fixes #6223. 2017-11-28 14:33:53 +00:00
unittest.nim Add unittest suite/test name filters 2017-11-28 13:12:23 +00:00
uri.nim Merge pull request #6597 from pgkos/uri-allow-no-authority 2018-01-28 17:00:33 +00:00
volatile.nim Add volatile load/store (#5263) 2017-01-25 20:02:19 +01:00
xmldom.nim Define getAttributes(NS) on PNode instead of PElement. 2016-12-28 18:26:25 +01:00
xmldomparser.nim lib: Trim .nim files trailing whitespace 2015-09-04 23:03:56 +02:00
xmlparser.nim fixes #1518 2016-10-20 23:44:55 +02:00
xmltree.nim Remove expr/stmt (#5857) 2017-07-25 09:28:23 +02:00