# HG changeset patch # User Mychaela Falconia # Date 1613151847 0 # Node ID 04e7e300809729d3c7bdc0a3931890dcfa171d39 # Parent 360d07419357c6258b6c05cb42e153da7ab0af24 -p reader selection implemented in fc-simtool diff -r 360d07419357 -r 04e7e3008097 simtool/main.c --- 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