Repeat what you tell me to.
(self, args, extra, *, keyword_arg: str | None = None)
| 92 | |
| 93 | @cmd2.with_argparser(_speak_parser_builder, with_unknown_args=True) |
| 94 | def do_speak(self, args, extra, *, keyword_arg: str | None = None) -> None: |
| 95 | """Repeat what you tell me to.""" |
| 96 | words = [] |
| 97 | for word in extra: |
| 98 | modified_word = word |
| 99 | if word is None: |
| 100 | modified_word = "" |
| 101 | if args.piglatin: |
| 102 | modified_word = f"{word[1:]}{word[0]}ay" |
| 103 | if args.shout: |
| 104 | modified_word = word.upper() |
| 105 | words.append(modified_word) |
| 106 | repetitions = args.repeat or 1 |
| 107 | for _ in range(min(repetitions, self.maxrepeats)): |
| 108 | self.stdout.write(" ".join(words)) |
| 109 | self.stdout.write("\n") |
| 110 | |
| 111 | if keyword_arg is not None: |
| 112 | print(keyword_arg) |
| 113 | |
| 114 | @cmd2.with_argparser(cmd2.Cmd2ArgumentParser(), preserve_quotes=True, with_unknown_args=True) |
| 115 | def do_test_argparse_with_list_quotes(self, args, extra) -> None: |
no test coverage detected