pySim-shell: add echo command

There is no convinient way to echo strings from scripts.

Change-Id: Iaed1d24eeb7f887e46957971083cd30d8d1bea6c
Related: SYS#5617
This commit is contained in:
Philipp Maier 2021-09-22 16:43:13 +02:00
parent 5d698e575a
commit b52feede25
1 changed files with 7 additions and 0 deletions

View File

@ -202,6 +202,13 @@ class PysimApp(cmd2.Cmd):
rs, card = init_card(sl);
self.equip(card, rs)
echo_parser = argparse.ArgumentParser()
echo_parser.add_argument('string', help="string to echo on the shell")
@cmd2.with_argparser(echo_parser)
@cmd2.with_category(CUSTOM_CATEGORY)
def do_echo(self, opts):
self.poutput(opts.string)
@with_default_category('pySim Commands')
class PySimCommands(CommandSet):