File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -669,6 +669,8 @@ using the :py:meth:`.Path.get_content` method. For the previous example would be
669669``info_db = cfg.databases.info.get_content() ``.
670670
671671An argument with a path type can be given ``nargs='+' `` to parse multiple paths.
672+ The CLI syntax for a list of paths is ``[/path/a,/path/b] `` for the default yaml
673+ loader and ``["/path/a","/path/b"] `` for the json loader.
672674But it might also be wanted to parse a list of paths found in a plain text file
673675or from stdin. For this add the argument with type ``List[<path_type>] `` and
674676``enable_path=True ``. To read from stdin give the special string ``'-' ``.
@@ -703,6 +705,10 @@ Example:
703705If ``nargs='+' `` is given to ``add_argument `` with ``List[<path_type>] `` and
704706``enable_path=True `` then for each argument a list of paths is generated.
705707
708+ Path list arguments can also be specified using the
709+ :py:meth: `.ArgumentParser.add_class_arguments ` method. To do so, specify
710+ ``List[<path_type>] `` as your class member's type.
711+
706712.. note ::
707713
708714 Not all features of the :class: `.Path ` class are supported on Windows.
You can’t perform that action at this time.
0 commit comments