dexter has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/41748?usp=email )
Change subject: pySim-shell: do not show user home path in help text ......................................................................
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 --- M pySim-shell.py 1 file changed, 3 insertions(+), 3 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/48/41748/1
diff --git a/pySim-shell.py b/pySim-shell.py index a8b15d5..26bf12c 100755 --- a/pySim-shell.py +++ b/pySim-shell.py @@ -1138,7 +1138,7 @@
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 @@ 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())