]> err.no Git - yubikey-personalization.old/commitdiff
Since slot choosing resets options, demand it comes first.
authorFredrik Thulin <fredrik@yubico.com>
Tue, 12 Apr 2011 15:14:49 +0000 (17:14 +0200)
committerFredrik Thulin <fredrik@yubico.com>
Tue, 12 Apr 2011 15:14:49 +0000 (17:14 +0200)
ykpers-args.c

index 49c2baf55bb0a3e0cc035f073a5038e15248319b..a25d6a80a2536f40fea72cbf5923ed5194858d4f 100644 (file)
@@ -245,6 +245,11 @@ int args_to_config(int argc, char **argv, YKP_CONFIG *cfg,
                                *exit_code = 1;
                                return 0;
                        }
+                       if (option_seen) {
+                               fprintf(stderr, "You must choose slot before any options (-o).\n");
+                               *exit_code = 1;
+                               return 0;
+                       }
                        if (!ykp_configure_for(cfg, 1, st))
                                return 0;
                        slot_chosen = true;
@@ -255,6 +260,11 @@ int args_to_config(int argc, char **argv, YKP_CONFIG *cfg,
                                *exit_code = 1;
                                return 0;
                        }
+                       if (option_seen) {
+                               fprintf(stderr, "You must choose slot before any options (-o).\n");
+                               *exit_code = 1;
+                               return 0;
+                       }
                        if (!ykp_configure_for(cfg, 2, st))
                                return 0;
                        slot_chosen = true;