Skip to content

Commit 8690784

Browse files
fix: validate arguments before usage in mkconcore.py (Issue #267)
1 parent ba1a79e commit 8690784

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

mkconcore.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,11 @@ def _resolve_concore_path():
137137
return os.getcwd()
138138
return SCRIPT_DIR
139139

140+
if len(sys.argv) < 4:
141+
logging.error("usage: py mkconcore.py file.graphml sourcedir outdir [type]")
142+
logging.error(" type must be posix (macos or ubuntu), windows, or docker")
143+
quit()
144+
140145
GRAPHML_FILE = sys.argv[1]
141146
TRIMMED_LOGS = True
142147
CONCOREPATH = _resolve_concore_path()
@@ -202,11 +207,7 @@ def _resolve_concore_path():
202207
logging.error(f"{sourcedir} does not exist")
203208
quit()
204209

205-
if len(sys.argv) < 4:
206-
logging.error("usage: py mkconcore.py file.graphml sourcedir outdir [type]")
207-
logging.error(" type must be posix (macos or ubuntu), windows, or docker")
208-
quit()
209-
elif len(sys.argv) == 4:
210+
if len(sys.argv) == 4:
210211
prefixedgenode = outdir+"_" #nodes and edges prefixed with outdir_ only in case no type specified 3/24/21
211212
concoretype = "docker"
212213
else:

0 commit comments

Comments
 (0)