def kitten_parse(func: str, rest: str) -> FuncArgsType: if func == 'kitten': args = rest.split(maxsplit=1) else: args = rest.split(maxsplit=2)[1:] func = 'kitten' return func, [args[0]] + (to_cmdline(args[1]) if len(args) > 1 else [])
def shlex_parse(func: str, rest: str) -> FuncArgsType: return func, to_cmdline(rest)