Skip to content

Commit

Permalink
Reminded that help message is optional.
Browse files Browse the repository at this point in the history
  • Loading branch information
matejak committed Dec 6, 2017
1 parent 4004d64 commit b9f3973
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions doc/guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ Positional arguments
* Single-value positional argument (with optional default):
::

ARG_POSITIONAL_SINGLE([argument-name], [help message], [default (optional)])
ARG_POSITIONAL_SINGLE([argument-name], [help message (optional)], [default (optional)])

The argument is mandatory, unless you specify a default.

Expand All @@ -136,7 +136,7 @@ Positional arguments
* Multi-value positional argument (with optional defaults):
::

ARG_POSITIONAL_MULTI([argument-name], [help message], [number of arguments], ..., [default for the second-to-last (i.e. penultimate) argument (optional)], [default for the last argument (optional)])
ARG_POSITIONAL_MULTI([argument-name], [help message (optional)], [number of arguments], ..., [default for the second-to-last (i.e. penultimate) argument (optional)], [default for the last argument (optional)])

Given that your argument accepts :math:`n` values, you can specify :math:`m` defaults, :math:`(m \leq n)` for last :math:`m` values.

Expand All @@ -151,7 +151,7 @@ Positional arguments
* Infinitely many-valued positional argument (with optional defaults):
::

ARG_POSITIONAL_INF([argument-name], [help message], [minimal number of arguments (optional, default=0)], [default for the first non-required argument (optional)], ...)
ARG_POSITIONAL_INF([argument-name], [help message (optional)], [minimal number of arguments (optional, default=0)], [default for the first non-required argument (optional)], ...)

``Argbash`` supports arguments with arbitrary number of values.
However, you can require a minimal amount of values the caller has to provide and you can also assign defaults for the values that are not required.
Expand Down Expand Up @@ -187,21 +187,21 @@ Optional arguments
* Single-value optional arguments:
::

ARG_OPTIONAL_SINGLE([argument-name-long], [argument-name-short (optional)], [help message], [default (optional)])
ARG_OPTIONAL_SINGLE([argument-name-long], [argument-name-short (optional)], [help message (optional)], [default (optional)])

The default default is an empty string.

* Boolean optional arguments:
::

ARG_OPTIONAL_BOOLEAN([argument-name-long], [argument-name-short (optional)], [help message], [default (optional)])
ARG_OPTIONAL_BOOLEAN([argument-name-long], [argument-name-short (optional)], [help message (optional)], [default (optional)])

The default default is ``off`` (the only alternative is ``on``).

* Incremental optional arguments:
::

ARG_OPTIONAL_INCREMENTAL([argument-name-long], [argument-name-short (optional)], [help message], [default (optional)])
ARG_OPTIONAL_INCREMENTAL([argument-name-long], [argument-name-short (optional)], [help message (optional)], [default (optional)])

The default default is 0.
The argument accepts no values on command-line, but it tracks a numerical value internally.
Expand All @@ -210,7 +210,7 @@ Optional arguments
* Repeated optional arguments:
::

ARG_OPTIONAL_REPEATED([argument-name-long], [argument-name-short (optional)], [help message], [default (optional)])
ARG_OPTIONAL_REPEATED([argument-name-long], [argument-name-short (optional)], [help message (optional)], [default (optional)])

The default default is an empty array.
The argument can be repeated multiple times, but instead of the later specifications overriding earlier ones (s.a. ``ARG_OPTIONAL_SINGLE`` does), arguments are gradually appended to an array.
Expand All @@ -225,7 +225,7 @@ Optional arguments
* Action optional arguments (i.e. the ``--version`` and ``--help`` type of comments):
::

ARG_OPTIONAL_ACTION([argument-name-long], [argument-name-short (optional)], [help message], [code to execute when specified])
ARG_OPTIONAL_ACTION([argument-name-long], [argument-name-short (optional)], [help message (optional)], [code to execute when specified])

The scripts exits after the argument is encountered.
You can specify a name of a function, ``echo "my-script: v0.5"`` and whatever else.
Expand Down

0 comments on commit b9f3973

Please sign in to comment.