pySim-shell: add command to show file description

All all files (CardFile) have a human readable description but there is
no command to display that description yet

Change-Id: If716cf3c6b09d53dca652b588671487d5343cf58
Related: OS#4963
This commit is contained in:
Philipp Maier 2021-03-10 16:20:02 +01:00 committed by laforge
parent 98f872bed1
commit 2558aa6999
1 changed files with 8 additions and 0 deletions

View File

@ -81,6 +81,14 @@ class PysimApp(cmd2.Cmd):
pin_adm = sanitize_pin_adm(arg)
self.card.verify_adm(h2b(pin_adm))
@cmd2.with_category(CUSTOM_CATEGORY)
def do_desc(self, opts):
"""Display human readable file description for the currently selected file"""
desc = self.rs.selected_file.desc
if desc:
self.poutput(desc)
else:
self.poutput("no description available")
@with_default_category('ISO7816 Commands')