Given a list of tokens, return a tuple of the command and the args as a string.
(tokens: list[str])
| 683 | |
| 684 | @staticmethod |
| 685 | def _command_and_args(tokens: list[str]) -> tuple[str, str]: |
| 686 | """Given a list of tokens, return a tuple of the command and the args as a string.""" |
| 687 | command = "" |
| 688 | args = "" |
| 689 | |
| 690 | if tokens: |
| 691 | command = tokens[0] |
| 692 | |
| 693 | if len(tokens) > 1: |
| 694 | args = " ".join(tokens[1:]) |
| 695 | |
| 696 | return command, args |
| 697 | |
| 698 | def split_on_punctuation(self, tokens: list[str]) -> list[str]: |
| 699 | """Further splits tokens from a command line using punctuation characters. |
no outgoing calls