diff --git a/DOCUMENTATION.rst b/DOCUMENTATION.rst index 58e8a2c6..0d660c6a 100644 --- a/DOCUMENTATION.rst +++ b/DOCUMENTATION.rst @@ -669,6 +669,8 @@ using the :py:meth:`.Path.get_content` method. For the previous example would be ``info_db = cfg.databases.info.get_content()``. An argument with a path type can be given ``nargs='+'`` to parse multiple paths. +The CLI syntax for a list of paths is ``[/path/a,/path/b]`` for the default yaml +loader and ``["/path/a","/path/b"]`` for the json loader. But it might also be wanted to parse a list of paths found in a plain text file or from stdin. For this add the argument with type ``List[]`` and ``enable_path=True``. To read from stdin give the special string ``'-'``. @@ -703,6 +705,10 @@ Example: If ``nargs='+'`` is given to ``add_argument`` with ``List[]`` and ``enable_path=True`` then for each argument a list of paths is generated. +Path list arguments can also be specified using the +:py:meth:`.ArgumentParser.add_class_arguments` method. To do so, specify +``List[]`` as your class member's type. + .. note:: Not all features of the :class:`.Path` class are supported on Windows.