diff options
author | Federico Ceratto <federico.ceratto@gmail.com> | 2017-11-14 10:05:58 +0000 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2017-11-14 11:05:58 +0100 |
commit | ab938fc901d1eb00ef973c22ec94d660682208b0 (patch) | |
tree | 0724f8f415372ba03cfb536aff23116e290e199c /lib | |
parent | 22ceab0fbb29241f72149fe4d53749d57861ba6f (diff) | |
download | Nim-ab938fc901d1eb00ef973c22ec94d660682208b0.tar.gz |
Clarify paramStr / paramCount use and availability (#6727)
Diffstat (limited to 'lib')
-rw-r--r-- | lib/pure/os.nim | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/lib/pure/os.nim b/lib/pure/os.nim index a1ae4e250..8b26552de 100644 --- a/lib/pure/os.nim +++ b/lib/pure/os.nim @@ -1195,14 +1195,15 @@ when defined(nimdoc): ## Returns the number of `command line arguments`:idx: given to the ## application. ## - ## If your binary was called without parameters this will return zero. You - ## can later query each individual paramater with `paramStr() <#paramStr>`_ + ## Unlike `argc`:idx: in C, if your binary was called without parameters this + ## will return zero. + ## You can query each individual paramater with `paramStr() <#paramStr>`_ ## or retrieve all of them in one go with `commandLineParams() ## <#commandLineParams>`_. ## - ## **Availability**: On Posix there is no portable way to get the command - ## line from a DLL and thus the proc isn't defined in this environment. You - ## can test for its availability with `declared() <system.html#declared>`_. + ## **Availability**: When generating a dynamic library (see --app:lib) on + ## Posix this proc is not defined. + ## Test for availability using `declared() <system.html#declared>`_. ## Example: ## ## .. code-block:: nim @@ -1219,13 +1220,14 @@ when defined(nimdoc): ## `paramCount() <#paramCount>`_ with this proc you can call the ## convenience `commandLineParams() <#commandLineParams>`_. ## - ## It is possible to call ``paramStr(0)`` but this will return OS specific + ## Similarly to `argv`:idx: in C, + ## it is possible to call ``paramStr(0)`` but this will return OS specific ## contents (usually the name of the invoked executable). You should avoid ## this and call `getAppFilename() <#getAppFilename>`_ instead. ## - ## **Availability**: On Posix there is no portable way to get the command - ## line from a DLL and thus the proc isn't defined in this environment. You - ## can test for its availability with `declared() <system.html#declared>`_. + ## **Availability**: When generating a dynamic library (see --app:lib) on + ## Posix this proc is not defined. + ## Test for availability using `declared() <system.html#declared>`_. ## Example: ## ## .. code-block:: nim |