migrate some usage text to call PrintAndLogOptions()

This commit is contained in:
Brian Pow 2018-03-01 23:55:13 +08:00
commit a352dbd93f

View file

@ -333,24 +333,29 @@ int usage_15_dump(void){
return 0; return 0;
} }
int usage_15_restore(void){ int usage_15_restore(void){
PrintAndLogEx(NORMAL, "Usage: hf 15 restore [-2] [-o] [h] [r <NUM>] [u <UID>] [f <filename>] [b <block size>]\n" char *options[][2]={
"Options:\n" {"h", "this help"},
"\th this help\n" {"-2", "use slower '1 out of 256' mode"},
"\t-2 use slower '1 out of 256' mode\n" {"-o", "set OPTION Flag (needed for TI)"},
"\t-o set OPTION Flag (needed for TI)\n" {"r <NUM>", "numbers of retries on error, default is 3"},
"\tr <NUM> numbers of retries on error, default is 3\n" {"u <UID>", "load hf-15-dump-<UID>.bin"},
"\tu <UID> load hf-15-dump-<UID>.bin\n" {"f <filename>", "load <filename>"},
"\tf <filename> load <filename>\n" {"b <block size>", "block size, default is 4"}
"\tb <block size> block size, default is 4"); };
return 0; PrintAndLogEx(NORMAL, "Usage: hf 15 restore [-2] [-o] [h] [r <NUM>] [u <UID>] [f <filename>] [b <block size>]");
PrintAndLogOptions(options, 7, 3);
return 0;
} }
int usage_15_raw(void){ int usage_15_raw(void){
PrintAndLogEx(NORMAL, "Usage: hf 15 raw [-r] [-2] [-c] <0A 0B 0C ... hex>\n" char *options[][2]={
"\t-r do not read response\n" {"-r", "do not read response" },
"\t-2 use slower '1 out of 256' mode\n" {"-2", "use slower '1 out of 256' mode" },
"\t-c calculate and append CRC\n" {"-c", "calculate and append CRC" },
"\tTip: turn on debugging for verbose output"); {"", "Tip: turn on debugging for verbose output"},
return 0; };
PrintAndLogEx(NORMAL, "Usage: hf 15 raw [-r] [-2] [-c] <0A 0B 0C ... hex>\n");
PrintAndLogOptions(options, 4, 3);
return 0;
} }
int usage_15_read(void){ int usage_15_read(void){
PrintAndLogEx(NORMAL, "Usage: hf 15 read [options] <uid|s|u|*> <page#>\n" PrintAndLogEx(NORMAL, "Usage: hf 15 read [options] <uid|s|u|*> <page#>\n"