Split the string *str_to_split* using shell-like syntax. A wrapper around shlex.split() that uses cmd2's preferred arguments. This allows other classes to easily call split() the same way StatementParser does. :param str_to_split: the string being split :return: A list of tokens
(str_to_split: str)
| 32 | |
| 33 | |
| 34 | def shlex_split(str_to_split: str) -> list[str]: |
| 35 | """Split the string *str_to_split* using shell-like syntax. |
| 36 | |
| 37 | A wrapper around shlex.split() that uses cmd2's preferred arguments. |
| 38 | |
| 39 | This allows other classes to easily call split() the same way StatementParser does. |
| 40 | |
| 41 | :param str_to_split: the string being split |
| 42 | :return: A list of tokens |
| 43 | """ |
| 44 | return shlex.split(str_to_split, comments=False, posix=False) |
| 45 | |
| 46 | |
| 47 | @dataclass(frozen=True, slots=True) |
no outgoing calls
searching dependent graphs…