dexter has submitted this change. ( https://gerrit.osmocom.org/c/pysim/+/25551 )
Change subject: pySim-shell: add echo command
......................................................................
pySim-shell: add echo command
There is no convinient way to echo strings from scripts.
Change-Id: Iaed1d24eeb7f887e46957971083cd30d8d1bea6c
Related: SYS#5617
---
M pySim-shell.py
1 file changed, 7 insertions(+), 0 deletions(-)
Approvals:
Jenkins Builder: Verified
laforge: Looks good to me, approved
osmith: Looks good to me, but someone else must approve
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 @@
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):
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/25551
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: Iaed1d24eeb7f887e46957971083cd30d8d1bea6c
Gerrit-Change-Number: 25551
Gerrit-PatchSet: 9
Gerrit-Owner: dexter <[email protected]>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter <[email protected]>
Gerrit-Reviewer: laforge <[email protected]>
Gerrit-Reviewer: osmith <[email protected]>
Gerrit-MessageType: merged