Allow quoted args to toggle_marker

This commit is contained in:
Daniel Lee Harple 2021-01-29 17:52:24 -05:00
parent 0fc93118f2
commit 2c24cc1341

View File

@ -298,11 +298,12 @@ def parse_marker_spec(ftype: str, parts: Sequence[str]) -> Tuple[str, Union[str,
@func_with_args('toggle_marker') @func_with_args('toggle_marker')
def toggle_marker(func: str, rest: str) -> FuncArgsType: def toggle_marker(func: str, rest: str) -> FuncArgsType:
import shlex
parts = rest.split(maxsplit=1) parts = rest.split(maxsplit=1)
if len(parts) != 2: if len(parts) != 2:
raise ValueError('{} is not a valid marker specification'.format(rest)) raise ValueError('{} is not a valid marker specification'.format(rest))
ftype, spec = parts ftype, spec = parts
parts = spec.split() parts = shlex.split(spec)
return func, list(parse_marker_spec(ftype, parts)) return func, list(parse_marker_spec(ftype, parts))