Change in pysim[master]: pySim-shell: add echo command

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

dexter gerrit-no-reply at lists.osmocom.org
Thu Sep 23 09:38:10 UTC 2021


dexter has uploaded this change for review. ( 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(-)



  git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/51/25551/1

diff --git a/pySim-shell.py b/pySim-shell.py
index 34a2436..6a49080 100755
--- a/pySim-shell.py
+++ b/pySim-shell.py
@@ -197,6 +197,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: 1
Gerrit-Owner: dexter <pmaier at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210923/4d6d4183/attachment.htm>


More information about the gerrit-log mailing list