aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhilipp Maier <pmaier@sysmocom.de>2021-09-22 16:43:13 +0200
committerPhilipp Maier <pmaier@sysmocom.de>2021-10-15 10:36:55 +0200
commitb52feede251205e3d0e423b74e7cc7b69ec46de7 (patch)
treeefd2c6e8c41dcd47a5ee2e79c0abad09ef063c2b
parent5d698e575aa55137817c129a21aa6c0a407b589b (diff)
pySim-shell: add echo command
There is no convinient way to echo strings from scripts. Change-Id: Iaed1d24eeb7f887e46957971083cd30d8d1bea6c Related: SYS#5617
-rwxr-xr-xpySim-shell.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/pySim-shell.py b/pySim-shell.py
index a57aa66..d24a881 100755
--- a/pySim-shell.py
+++ b/pySim-shell.py
@@ -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):