diff --git a/docsrc/options.rst b/docsrc/options.rst index f88bc04..d8f7a6e 100644 --- a/docsrc/options.rst +++ b/docsrc/options.rst @@ -112,6 +112,22 @@ Setting argument choices The ``choices`` property can be used to specify a list of choices for an option argument in the same way as for arguments. +.. code-block:: lua + :linenos: + + parser:option "--format" + :choices {"short", "medium", "full"} + +.. code-block:: none + + $ lua script.lua --format foo + +.. code-block:: none + + Usage: script.lua [-h] [--format {short,medium,full}] + + Error: argument for option '--format' must be one of 'short', 'medium', 'full' + Setting number of invocations -----------------------------