From 8690784ef6764244409e142131254b0716204362 Mon Sep 17 00:00:00 2001 From: Ganesh Patil <7030871503ganeshpatil@gmail.com> Date: Sun, 15 Feb 2026 10:33:26 +0530 Subject: [PATCH 1/2] fix: validate arguments before usage in mkconcore.py (Issue #267) --- mkconcore.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/mkconcore.py b/mkconcore.py index 9457d74..18a1ecb 100644 --- a/mkconcore.py +++ b/mkconcore.py @@ -137,6 +137,11 @@ def _resolve_concore_path(): return os.getcwd() return SCRIPT_DIR +if len(sys.argv) < 4: + logging.error("usage: py mkconcore.py file.graphml sourcedir outdir [type]") + logging.error(" type must be posix (macos or ubuntu), windows, or docker") + quit() + GRAPHML_FILE = sys.argv[1] TRIMMED_LOGS = True CONCOREPATH = _resolve_concore_path() @@ -202,11 +207,7 @@ def _resolve_concore_path(): logging.error(f"{sourcedir} does not exist") quit() -if len(sys.argv) < 4: - logging.error("usage: py mkconcore.py file.graphml sourcedir outdir [type]") - logging.error(" type must be posix (macos or ubuntu), windows, or docker") - quit() -elif len(sys.argv) == 4: +if len(sys.argv) == 4: prefixedgenode = outdir+"_" #nodes and edges prefixed with outdir_ only in case no type specified 3/24/21 concoretype = "docker" else: From 9e8e756b7360347d244716312e497e241f2dc5df Mon Sep 17 00:00:00 2001 From: Ganesh Patil <7030871503ganeshpatil@gmail.com> Date: Sun, 15 Feb 2026 10:46:21 +0530 Subject: [PATCH 2/2] fix: use print+sys.exit for early arg check before logging is configured --- mkconcore.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mkconcore.py b/mkconcore.py index 18a1ecb..4e01dde 100644 --- a/mkconcore.py +++ b/mkconcore.py @@ -138,9 +138,9 @@ def _resolve_concore_path(): return SCRIPT_DIR if len(sys.argv) < 4: - logging.error("usage: py mkconcore.py file.graphml sourcedir outdir [type]") - logging.error(" type must be posix (macos or ubuntu), windows, or docker") - quit() + print("usage: py mkconcore.py file.graphml sourcedir outdir [type]") + print(" type must be posix (macos or ubuntu), windows, or docker") + sys.exit(1) GRAPHML_FILE = sys.argv[1] TRIMMED_LOGS = True