diff options
| author | Egor Tensin <egor@tensin.name> | 2026-10-06 00:09:18 +0500 |
|---|---|---|
| committer | Egor Tensin <egor@tensin.name> | 2026-10-06 00:09:18 +0500 |
| commit | f2f9caddd1c0a5f065741e4d9bb5afcaf86d678c (patch) | |
| tree | 585e29f8a75826b5c4742a853ef9c3f0e9dde3a7 | |
| parent | project.ctest_driver: fix if no regexes (diff) | |
| download | cmake-common-f2f9caddd1c0a5f065741e4d9bb5afcaf86d678c.tar.gz cmake-common-f2f9caddd1c0a5f065741e4d9bb5afcaf86d678c.zip | |
consistent argparse.add_argument formatting
| -rw-r--r-- | project/boost/download.py | 6 | ||||
| -rw-r--r-- | project/build.py | 6 | ||||
| -rw-r--r-- | project/ctest_driver.py | 10 | ||||
| -rw-r--r-- | project/format.py | 5 | ||||
| -rw-r--r-- | project/version.py | 5 |
5 files changed, 26 insertions, 6 deletions
diff --git a/project/boost/download.py b/project/boost/download.py index 9388243..1576bab 100644 --- a/project/boost/download.py +++ b/project/boost/download.py @@ -145,7 +145,11 @@ def _parse_args(argv=None): type=normalize_path, help="download directory (temporary file unless specified)", ) - parser.add_argument("--no-retry", action="store_true", help=argparse.SUPPRESS) + parser.add_argument( + "--no-retry", + action="store_true", + help=argparse.SUPPRESS, + ) parser.add_argument( "version", metavar="VERSION", diff --git a/project/build.py b/project/build.py index 2a44bf5..fce5031 100644 --- a/project/build.py +++ b/project/build.py @@ -294,7 +294,11 @@ def _parse_args(argv=None): help="additional CMake arguments, to be passed verbatim", ) - parser.add_argument("src_dir", type=normalize_path, help="source directory") + parser.add_argument( + "src_dir", + type=normalize_path, + help="source directory", + ) parser.add_argument( "build_dir", type=normalize_path, diff --git a/project/ctest_driver.py b/project/ctest_driver.py index c78e6f1..c3157e1 100644 --- a/project/ctest_driver.py +++ b/project/ctest_driver.py @@ -156,7 +156,9 @@ def parse_args(argv=None): help="launch child process in a new console window", ) parser_run.add_argument( - "exe_path", metavar="PATH", help="path to the test executable" + "exe_path", + metavar="PATH", + help="path to the test executable", ) # nargs='*' here would discard additional '--'s. parser_run.add_argument( @@ -186,7 +188,11 @@ def parse_args(argv=None): metavar="REGEX", help="fail if any of these regexes matches", ) - parser_grep.add_argument("path", metavar="PATH", help="text file path") + parser_grep.add_argument( + "path", + metavar="PATH", + help="text file path", + ) parser_grep.set_defaults(func=action_grep) args = parser.parse_args(argv) diff --git a/project/format.py b/project/format.py index eeb3d6e..f98f726 100644 --- a/project/format.py +++ b/project/format.py @@ -153,7 +153,10 @@ def parse_args(argv=None): help="clang-format -style parameter argument", ) parser.add_argument( - "-i", "--in-place", action="store_true", help="edit the files in-place" + "-i", + "--in-place", + action="store_true", + help="edit the files in-place", ) parser.add_argument( "-e", diff --git a/project/version.py b/project/version.py index f39049f..994f00b 100644 --- a/project/version.py +++ b/project/version.py @@ -8,5 +8,8 @@ except: def add_to_arg_parser(parser): parser.add_argument( - "--version", "-V", action="version", version=f"%(prog)s {__version__}" + "--version", + "-V", + action="version", + version=f"%(prog)s {__version__}", ) |
