From 687cb6533c5a9f95492a4480955e34faa83b473c Mon Sep 17 00:00:00 2001 From: jvoisin Date: Sun, 17 Aug 2014 02:42:17 +0200 Subject: [PATCH] Colours more help --- libr/core/cmd_anal.c | 15 +++++++++------ libr/core/cmd_print.c | 16 +++++++++------- libr/core/cmd_search.c | 5 +---- 3 files changed, 19 insertions(+), 17 deletions(-) diff --git a/libr/core/cmd_anal.c b/libr/core/cmd_anal.c index dbbdfbd218..1f23591650 100644 --- a/libr/core/cmd_anal.c +++ b/libr/core/cmd_anal.c @@ -802,12 +802,15 @@ void cmd_anal_reg(RCore *core, const char *str) { case '+': r_reg_arena_push (core->dbg->reg); break; - case '?': - r_cons_printf ( - "|Usage: drs Register states commands\n" - "| drs List register stack\n" - "| drs+ Push register state\n" - "| drs- Pop register state\n"); + case '?':{ + const char* help_msg[] = { + "Usage:", "drs", " # Register states commands", + "drs", "", "List register stack", + "drs+", "", "Push register state", + "drs-", "", "Pop register state", + NULL}; + r_core_cmd_help (core, help_msg); + } break; default: r_cons_printf ("%d\n", r_list_length ( diff --git a/libr/core/cmd_print.c b/libr/core/cmd_print.c index 401bacc36a..2883a27b8d 100644 --- a/libr/core/cmd_print.c +++ b/libr/core/cmd_print.c @@ -1775,13 +1775,15 @@ static int cmd_print(void *data, const char *input) { r_print_date_w32 (core->print, core->block+l, sizeof (ut64)); core->print->big_endian = !core->print->big_endian; break; - case '?': - r_cons_printf ( - "|Usage: pt[dn?]\n" - "| pt print unix time (32 bit cfg.big_endian)\n" - "| ptd print dos time (32 bit cfg.big_endian)\n" - "| ptn print ntfs time (64 bit !cfg.big_endian)\n" - "| pt? show help message\n"); + case '?':{ + const char* help_msg[] = { + "Usage: pt", "[dn]", "print timestamps", + "pt", "", "print unix time (32 bit `cfg.big_endian`", + "ptd","", "print dos time (32 bit `cfg.big_endian`", + "ptn","", "print ntfs time (64 bit `cfg.big_endian`", + NULL}; + r_core_cmd_help (core, help_msg); + } break; } break; diff --git a/libr/core/cmd_search.c b/libr/core/cmd_search.c index 5ebf65cec9..1170f5f030 100644 --- a/libr/core/cmd_search.c +++ b/libr/core/cmd_search.c @@ -636,9 +636,6 @@ static int cmd_search(void *data, const char *input) { r_search_set_distance (core->search, (int) r_config_get_i (core->config, "search.distance")); switch (input[1]) { - case '?': - eprintf ("Usage: /v[1|2|4|8] [value] # obeys cfg.bigendian\n"); - return R_TRUE; case '8': n64 = r_num_math (core->num, input+2); r_mem_copyendian ((ut8*)&n64, (const ut8*)&n64, @@ -845,7 +842,7 @@ static int cmd_search(void *data, const char *input) { "/m", " magicfile", "search for matching magic file (use blocksize)", "/p", " patternsize", "search for pattern of given size", "/r", " sym.printf", "analyze opcode reference an offset", - "/v", "[?248] num", "look for a asm.bigendian 32bit value", + "/v", "[1248] value", "look for an `asm.bigendian` 32bit value", "/w", " foo", "search for wide string 'f\\0o\\0o\\0'", "/wi", " foo", "search for wide string ignoring case 'f\\0o\\0o\\0'", "/x"," ff..33", "search for hex string ignoring some nibbles",