changeset 36:04e7e3008097

-p reader selection implemented in fc-simtool
author Mychaela Falconia <falcon@freecalypso.org>
date Fri, 12 Feb 2021 17:44:07 +0000
parents 360d07419357
children acf343dace04
files simtool/main.c
diffstat 1 files changed, 5 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/simtool/main.c	Fri Feb 12 17:40:21 2021 +0000
+++ b/simtool/main.c	Fri Feb 12 17:44:07 2021 +0000
@@ -8,17 +8,19 @@
 main(argc, argv)
 	char **argv;
 {
+	extern int optind;
 	char command[512];
 	int rc;
 
+	parse_global_options(argc, argv);
 	setup_pcsc_context();
 	get_reader_list();
 	select_reader_by_num();
-	if (argc < 2)
+	if (argc <= optind)
 		printf("Card reader name: %s\n", selected_reader);
 	connect_to_card();
-	if (argc >= 2) {
-		rc = dispatch_ready_argv(argc - 1, argv + 1);
+	if (argc > optind) {
+		rc = dispatch_ready_argv(argc - optind, argv + optind);
 		if (rc)
 			error_exit();
 		else