From: Fredrik Thulin Date: Tue, 12 Apr 2011 15:14:49 +0000 (+0200) Subject: Since slot choosing resets options, demand it comes first. X-Git-Tag: v1.5.2~11 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ac91c2de62d3340c4230589ecd426acd71892a74;p=yubikey-personalization Since slot choosing resets options, demand it comes first. --- diff --git a/ykpers-args.c b/ykpers-args.c index 49c2baf..a25d6a8 100644 --- a/ykpers-args.c +++ b/ykpers-args.c @@ -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;