From 0ba3fd996aa4c72118bc670f067596930d9d173c Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Wed, 1 Nov 2023 19:18:24 +0100 Subject: [PATCH] pySim-shell: Add copyright statement and link to online manual to banner This way the users are reminded where they can go to read the manual. Change-Id: Ie86822e73bccb3c585cecc818d4462d4ca6e43c2 --- docs/shell.rst | 8 ++++++++ pySim-shell.py | 5 ++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/docs/shell.rst b/docs/shell.rst index 81e84d24..f4374952 100644 --- a/docs/shell.rst +++ b/docs/shell.rst @@ -202,6 +202,14 @@ intro ~~~~~ [Re-]Display the introductory banner +Example: +:: + + pySIM-shell (00:MF)> intro + Welcome to pySim-shell! + (C) 2021-2023 by Harald Welte, sysmocom - s.f.m.c. GmbH and contributors + Online manual available at https://downloads.osmocom.org/docs/pysim/master/html/shell.html + equip ~~~~~ diff --git a/pySim-shell.py b/pySim-shell.py index bbb14b27..c02555f8 100755 --- a/pySim-shell.py +++ b/pySim-shell.py @@ -174,6 +174,9 @@ class Settable2Compat(cmd2.Settable): class PysimApp(Cmd2Compat): CUSTOM_CATEGORY = 'pySim Commands' + BANNER = """Welcome to pySim-shell! +(C) 2021-2023 by Harald Welte, sysmocom - s.f.m.c. GmbH and contributors +Online manual available at https://downloads.osmocom.org/docs/pysim/master/html/shell.html """ def __init__(self, card, rs, sl, ch, script=None): if version.parse(cmd2.__version__) < version.parse("2.0.0"): @@ -184,7 +187,7 @@ class PysimApp(Cmd2Compat): # pylint: disable=unexpected-keyword-arg super().__init__(persistent_history_file='~/.pysim_shell_history', allow_cli_args=False, auto_load_commands=False, startup_script=script, **kwargs) - self.intro = style('Welcome to pySim-shell!', fg=RED) + self.intro = style(self.BANNER, fg=RED) self.default_category = 'pySim-shell built-in commands' self.card = None self.rs = None