Skip to content

Commit 656ba0a

Browse files
fix: quote list of args (#62)
1 parent ba3bef2 commit 656ba0a

1 file changed

Lines changed: 3 additions & 6 deletions

File tree

  • snakemake_interface_executor_plugins

snakemake_interface_executor_plugins/utils.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,10 @@ def format_cli_pos_arg(value, quote=True):
4040
elif not_iterable(value):
4141
return format_cli_value(value)
4242
else:
43-
return join_cli_args(
44-
format_cli_value(v, quote_if_contains_whitespace=True) for v in value
45-
)
43+
return join_cli_args(format_cli_value(v, quote=True) for v in value)
4644

4745

48-
def format_cli_value(value: Any, quote_if_contains_whitespace: bool = False) -> str:
46+
def format_cli_value(value: Any, quote: bool = False) -> str:
4947
if isinstance(value, SettingsEnumBase):
5048
return value.item_to_choice()
5149
elif isinstance(value, Path):
@@ -54,8 +52,7 @@ def format_cli_value(value: Any, quote_if_contains_whitespace: bool = False) ->
5452
if is_quoted(value):
5553
# the value is already quoted, do not quote again
5654
return value
57-
elif quote_if_contains_whitespace and " " in value:
58-
# may be expression
55+
elif quote:
5956
return repr(value)
6057
else:
6158
return value

0 commit comments

Comments
 (0)