Skip to content
Myr

Added notes on missing "+" from argparse

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Armin Ronacher · committed by Armin Ronacher · parent 72ae8a2 · Browse files · 1 file+11 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+11 added−0 removed

  • other:+11 added−0 removed

1 file+11 added−0 removed

modified:docs/arguments.rst+11 added
56 unmodified lines
57.. click:run::5859 invoke(copy, args=['foo.txt', 'bar.txt', 'my_folder'])6061.. admonition:: Note on Non-Empty Variadic Arguments6263 If you come from ``argparse`` you might be missing support for setting64 ``nargs`` to ``+`` to indicate that at least one argument is required.6566 Support for this is very intentionally not included as we believe67 scripts should gracefully degrate into becomming noops if a variadic68 argument is empty. The reason for this is that very often scripts are69 invoked with wildcard inputs from the command line and they should not70 error out if the wildcard is empty.7172.. _file-args:7374File Arguments75--------------
90 unmodified lines