diff uicc/dispatch.c @ 133:ede661d78730

fc-uicc-tool: command shell features match fc-simtool
author Mychaela Falconia <falcon@freecalypso.org>
date Sat, 20 Feb 2021 22:30:54 +0000
parents 8e70ee7c194f
children 58406ead2497
line wrap: on
line diff
--- a/uicc/dispatch.c	Sat Feb 20 22:23:03 2021 +0000
+++ b/uicc/dispatch.c	Sat Feb 20 22:30:54 2021 +0000
@@ -9,6 +9,7 @@
 #include <stdlib.h>
 
 extern int cmd_apdu();
+extern int cmd_cd();
 extern int cmd_change_pin();
 extern int cmd_dir();
 extern int cmd_disable_pin();
@@ -44,13 +45,14 @@
 } cmdtab[] = {
 	{"apdu", 1, 1, 0, cmd_apdu},
 	{"atr", 0, 0, 0, retrieve_atr},
+	{"cd", 1, 1, 0, cmd_cd},
 	{"change-pin", 3, 3, 0, cmd_change_pin},
 	{"dir", 0, 0, 1, cmd_dir},
 	{"disable-pin", 2, 2, 0, cmd_disable_pin},
 	{"enable-pin", 2, 2, 0, cmd_enable_pin},
 	{"exec", 1, 1, 0, cmd_exec},
 	{"exit", 0, 0, 0, good_exit},
-	{"iccid", 0, 0, 0, cmd_iccid},
+	{"iccid", 0, 0, 1, cmd_iccid},
 	{"pin-attempt-cnt", 1, 1, 0, cmd_pin_attempt_cnt},
 	{"puk-attempt-cnt", 1, 1, 0, cmd_puk_attempt_cnt},
 	{"quit", 0, 0, 0, good_exit},
@@ -116,6 +118,8 @@
 		return(0);
 	if (is_script)
 		printf("Script command: %s\n", cp);
+	if (*cp == '!')
+		return system(cp + 1);
 	argv[0] = cp;
 	while (*cp && !isspace(*cp))
 		cp++;