From f62866f4d358adb2076c3581994d4eb1baccf354 Mon Sep 17 00:00:00 2001 From: Philipp Maier Date: Wed, 10 Mar 2021 17:13:15 +0100 Subject: [PATCH] pySim-shell: output currently selected file using select command When the select command is entered with no parameters it fails with an exception. Lets just output the currently selected file and exit instead. Change-Id: I541bd5ed14f240cd1c2bd63647c830f669d26130 Related: OS#4963 --- pySim-shell.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pySim-shell.py b/pySim-shell.py index 09749dc9..8e222f3e 100755 --- a/pySim-shell.py +++ b/pySim-shell.py @@ -90,6 +90,12 @@ class Iso7816Commands(CommandSet): def do_select(self, opts): """SELECT a File (ADF/DF/EF)""" + if len(opts.arg_list) == 0: + path_list = self._cmd.rs.selected_file.fully_qualified_path(True) + path_list_fid = self._cmd.rs.selected_file.fully_qualified_path(False) + self._cmd.poutput("currently selected file: " + '/'.join(path_list) + " (" + '/'.join(path_list_fid) + ")") + return + path = opts.arg_list[0] fcp_dec = self._cmd.rs.select(path, self._cmd) self._cmd.update_prompt()