From 9648d206e2522acf8be5b9bc480043652bd09528 Mon Sep 17 00:00:00 2001 From: alexfurmenkov Date: Mon, 6 Apr 2026 19:24:28 +0200 Subject: [PATCH 1/3] stop execution when multiple --data options are provided --- README.md | 2 +- core.py | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index f501b42ac..e14f11007 100644 --- a/README.md +++ b/README.md @@ -138,7 +138,7 @@ This will show the list of validation options. -ca, --cache TEXT Relative path to cache files containing pre loaded metadata and rules -ps, --pool-size INTEGER Number of parallel processes for validation - -d, --data TEXT Path to directory containing data files + -d, --data TEXT Path to directory containing data files. Can can only be provided once. -dp, --dataset-path TEXT Absolute path to dataset file. Can be specified multiple times. -dxp, --define-xml-path TEXT Path to Define-XML -l, --log-level [info|debug|error|critical|disabled|warn] diff --git a/core.py b/core.py index 9d13312bc..f7a739d48 100644 --- a/core.py +++ b/core.py @@ -221,6 +221,7 @@ def _validate_no_arguments(logger) -> None: "-d", "--data", required=False, + multiple=True, help=f"Path to directory containing data files ({VALIDATION_FORMATS_MESSAGE})", ) @click.option( @@ -518,6 +519,11 @@ def validate( # noqa ) # Validate dataset arguments if data: + if len(data) != 1: + logger.error("Argument --data can only be provided once.") + ctx.exit(2) + else: + data = data[0] if dataset_path: logger.error( "Argument --dataset-path cannot be used together with argument --data" From 3f540d1f14c74ae30bdf8280aee92cf5a7318610 Mon Sep 17 00:00:00 2001 From: alexfurmenkov Date: Tue, 7 Apr 2026 18:14:03 +0200 Subject: [PATCH 2/3] changed README.md and cli parameter to reflect correct logic --- README.md | 2 +- core.py | 6 ------ 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/README.md b/README.md index e14f11007..a56c3c3bb 100644 --- a/README.md +++ b/README.md @@ -138,7 +138,7 @@ This will show the list of validation options. -ca, --cache TEXT Relative path to cache files containing pre loaded metadata and rules -ps, --pool-size INTEGER Number of parallel processes for validation - -d, --data TEXT Path to directory containing data files. Can can only be provided once. + -d, --data TEXT Path to directory containing data files. Should only be provided once. If provided more than once, only the last value will be recorded. -dp, --dataset-path TEXT Absolute path to dataset file. Can be specified multiple times. -dxp, --define-xml-path TEXT Path to Define-XML -l, --log-level [info|debug|error|critical|disabled|warn] diff --git a/core.py b/core.py index f7a739d48..9d13312bc 100644 --- a/core.py +++ b/core.py @@ -221,7 +221,6 @@ def _validate_no_arguments(logger) -> None: "-d", "--data", required=False, - multiple=True, help=f"Path to directory containing data files ({VALIDATION_FORMATS_MESSAGE})", ) @click.option( @@ -519,11 +518,6 @@ def validate( # noqa ) # Validate dataset arguments if data: - if len(data) != 1: - logger.error("Argument --data can only be provided once.") - ctx.exit(2) - else: - data = data[0] if dataset_path: logger.error( "Argument --dataset-path cannot be used together with argument --data" From 884fc3250df46d1a819a8c0e56e96d050e158cba Mon Sep 17 00:00:00 2001 From: alexfurmenkov Date: Tue, 7 Apr 2026 20:20:59 +0200 Subject: [PATCH 3/3] updated help for -d validation option --- core.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core.py b/core.py index 9d13312bc..ed469089b 100644 --- a/core.py +++ b/core.py @@ -221,7 +221,8 @@ def _validate_no_arguments(logger) -> None: "-d", "--data", required=False, - help=f"Path to directory containing data files ({VALIDATION_FORMATS_MESSAGE})", + help=f"Path to directory containing data files ({VALIDATION_FORMATS_MESSAGE}). " + "Should be provided once. If provided more than once, only the last value will be recorded", ) @click.option( "-ft",