]> err.no Git - yubikey-personalization/commitdiff
update text depending on command to be written to key.
authorKlas Lindfors <klas@yubico.com>
Wed, 28 Mar 2012 06:10:53 +0000 (08:10 +0200)
committerKlas Lindfors <klas@yubico.com>
Wed, 28 Mar 2012 06:10:53 +0000 (08:10 +0200)
ykpersonalize.c

index ef24ebca7a1667e2dd29039ea532ebc8140b9cef..de0ff78c2c4b1e588a17d7de26f96fac269d4249 100644 (file)
@@ -197,8 +197,16 @@ int main(int argc, char **argv)
        } else {
                char commitbuf[256]; size_t commitlen;
 
-               fprintf(stderr, "Configuration data to be written to key configuration %d:\n\n", ykp_config_num(cfg));
-               ykp_write_config(cfg, writer, stderr);
+               if (ykp_command(cfg) == SLOT_SWAP) {
+                       fprintf(stderr, "Configuration in slot 1 and 2 will be swapped\n");
+               } else {
+                       if (ykp_command(cfg) == SLOT_CONFIG || ykp_command(cfg) == SLOT_CONFIG2) {
+                               fprintf(stderr, "Configuration data to be written to key configuration %d:\n\n", ykp_config_num(cfg));
+                       } else {
+                               fprintf(stderr, "Configuration data to be updated in key configuration %d:\n\n", ykp_command(cfg) == SLOT_UPDATE1 ? 1 : 2);
+                       }
+                       ykp_write_config(cfg, writer, stderr);
+               }
                fprintf(stderr, "\nCommit? (y/n) [n]: ");
                if (autocommit) {
                        strcpy(commitbuf, "yes");