Skip to content

Commit 075c93e

Browse files
committed
Add boolean flag parameter support in CommandExecutor.run_topp()
Handle POSIX-style boolean flags in TOPP tool parameters where 'true' emits -flag only (no value) and 'false' skips the parameter entirely. This fixes tools like FLASHDeconv and FLASHTnT that expect flag-style boolean parameters rather than -flag true/-flag false. https://claude.ai/code/session_01R4Uj1R6TMZ6biZ6Ks9HT4C
1 parent c65d503 commit 075c93e

File tree

1 file changed

+15
-8
lines changed

1 file changed

+15
-8
lines changed

src/workflow/CommandExecutor.py

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -284,14 +284,21 @@ def run_topp(self, tool: str, input_output: dict, custom_params: dict = {}) -> b
284284
# Add non-default TOPP tool parameters
285285
if tool in params.keys():
286286
for k, v in params[tool].items():
287-
command += [f"-{k}"]
288-
# Skip only empty strings (pass flag with no value)
289-
# Note: 0 and 0.0 are valid values, so use explicit check
290-
if v != "" and v is not None:
291-
if isinstance(v, str) and "\n" in v:
292-
command += v.split("\n")
293-
else:
294-
command += [str(v)]
287+
# Handle boolean flag parameters:
288+
# 'true' → emit -flag only, 'false' → skip entirely
289+
if isinstance(v, str) and v.lower() == "true":
290+
command += [f"-{k}"]
291+
elif isinstance(v, str) and v.lower() == "false":
292+
continue
293+
else:
294+
command += [f"-{k}"]
295+
# Skip only empty strings (pass flag with no value)
296+
# Note: 0 and 0.0 are valid values, so use explicit check
297+
if v != "" and v is not None:
298+
if isinstance(v, str) and "\n" in v:
299+
command += v.split("\n")
300+
else:
301+
command += [str(v)]
295302
# Add custom parameters
296303
for k, v in custom_params.items():
297304
command += [f"-{k}"]

0 commit comments

Comments
 (0)