From d764659a301706c676eeba3d37fb2c5c4ba254bd Mon Sep 17 00:00:00 2001 From: Philipp Maier Date: Mon, 22 Dec 2025 14:07:18 +0100 Subject: [PATCH] pySim-shell: do not show user home path in help text At the moment, the help text for the --csv option shows the path to the users home. This is due to the default value, which is dynamically generated. Let's use a static string with "~/" and resolve the full path later when we need it. Related: SYS#7725 Change-Id: Ied8b1e553de8f5370369c4485a2360906c874ed2 --- pySim-shell.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pySim-shell.py b/pySim-shell.py index 75b7ef76..da3a26b4 100755 --- a/pySim-shell.py +++ b/pySim-shell.py @@ -1138,7 +1138,7 @@ global_group.add_argument("--verbose", help="Enable verbose logging", card_key_group = option_parser.add_argument_group('Card Key Provider Options') card_key_group.add_argument('--csv', metavar='FILE', - default=str(Path.home()) + "/.osmocom/pysim/card_data.csv", + default="~/.osmocom/pysim/card_data.csv", help='Read card data from CSV file') card_key_group.add_argument('--csv-column-key', metavar='FIELD:AES_KEY_HEX', default=[], action='append', help=argparse.SUPPRESS, dest='column_key') @@ -1177,8 +1177,8 @@ if __name__ == '__main__': for par in opts.column_key: name, key = par.split(':') column_keys[name] = key - if os.path.isfile(opts.csv): - card_key_provider_register(CardKeyProviderCsv(opts.csv, column_keys)) + if os.path.isfile(os.path.expanduser(opts.csv)): + card_key_provider_register(CardKeyProviderCsv(os.path.expanduser(opts.csv), column_keys)) # Init card reader driver sl = init_reader(opts, proactive_handler = Proact())