From 5a5b9966f60f39d3b5b7ed7c73460f5564c1cac8 Mon Sep 17 00:00:00 2001 From: Michael Hoss <33626467+michael-hoss@users.noreply.github.com> Date: Wed, 12 Nov 2025 15:32:10 +0100 Subject: [PATCH 1/2] Update documentation for path argument parsing Clarify CLI syntax for path arguments and usage. --- DOCUMENTATION.rst | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/DOCUMENTATION.rst b/DOCUMENTATION.rst index 58e8a2c6..50779544 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. From 85a739b42f0fec75a17738043def31bc25c0df13 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 12 Nov 2025 14:34:21 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- DOCUMENTATION.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/DOCUMENTATION.rst b/DOCUMENTATION.rst index 50779544..0d660c6a 100644 --- a/DOCUMENTATION.rst +++ b/DOCUMENTATION.rst @@ -705,8 +705,8 @@ 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 +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::