From a352dbd93f21a7924e127b21e3f7234bd9812404 Mon Sep 17 00:00:00 2001 From: Brian Pow Date: Thu, 1 Mar 2018 23:55:13 +0800 Subject: [PATCH] migrate some usage text to call PrintAndLogOptions() --- client/cmdhf15.c | 37 +++++++++++++++++++++---------------- 1 file changed, 21 insertions(+), 16 deletions(-) diff --git a/client/cmdhf15.c b/client/cmdhf15.c index f6516d31c..b599023a9 100644 --- a/client/cmdhf15.c +++ b/client/cmdhf15.c @@ -333,24 +333,29 @@ int usage_15_dump(void){ return 0; } int usage_15_restore(void){ - PrintAndLogEx(NORMAL, "Usage: hf 15 restore [-2] [-o] [h] [r ] [u ] [f ] [b ]\n" - "Options:\n" - "\th this help\n" - "\t-2 use slower '1 out of 256' mode\n" - "\t-o set OPTION Flag (needed for TI)\n" - "\tr numbers of retries on error, default is 3\n" - "\tu load hf-15-dump-.bin\n" - "\tf load \n" - "\tb block size, default is 4"); - return 0; + char *options[][2]={ + {"h", "this help"}, + {"-2", "use slower '1 out of 256' mode"}, + {"-o", "set OPTION Flag (needed for TI)"}, + {"r ", "numbers of retries on error, default is 3"}, + {"u ", "load hf-15-dump-.bin"}, + {"f ", "load "}, + {"b ", "block size, default is 4"} + }; + PrintAndLogEx(NORMAL, "Usage: hf 15 restore [-2] [-o] [h] [r ] [u ] [f ] [b ]"); + PrintAndLogOptions(options, 7, 3); + return 0; } int usage_15_raw(void){ - PrintAndLogEx(NORMAL, "Usage: hf 15 raw [-r] [-2] [-c] <0A 0B 0C ... hex>\n" - "\t-r do not read response\n" - "\t-2 use slower '1 out of 256' mode\n" - "\t-c calculate and append CRC\n" - "\tTip: turn on debugging for verbose output"); - return 0; + char *options[][2]={ + {"-r", "do not read response" }, + {"-2", "use slower '1 out of 256' mode" }, + {"-c", "calculate and append CRC" }, + {"", "Tip: turn on debugging for verbose output"}, + }; + 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){ PrintAndLogEx(NORMAL, "Usage: hf 15 read [options] \n"