mirror of
https://github.com/radareorg/radare2.git
synced 2024-11-27 15:10:53 +00:00
Rework e? and e?? commands for better output
This commit is contained in:
parent
a2a4597924
commit
2f5e236c19
@ -163,7 +163,7 @@ R_API void r_config_list(RConfig *cfg, const char *str, int rad) {
|
||||
const char *sfx = "";
|
||||
const char *pfx = "";
|
||||
int len = 0;
|
||||
bool verbose = false;
|
||||
bool found, verbose = false;
|
||||
PJ *pj = NULL;
|
||||
|
||||
if (!IS_NULLSTR (str)) {
|
||||
@ -215,17 +215,23 @@ R_API void r_config_list(RConfig *cfg, const char *str, int rad) {
|
||||
case 2:
|
||||
r_list_foreach (cfg->nodes, iter, node) {
|
||||
if (!str || (str && (!strncmp (str, node->name, len)))) {
|
||||
if (!str || !strncmp (str, node->name, len)) {
|
||||
if (R_STR_ISNOTEMPTY (str)) {
|
||||
cfg->cb_printf ("%s\n", r_str_get (node->desc));
|
||||
} else {
|
||||
cfg->cb_printf ("%20s: %s\n", node->name,
|
||||
r_str_get (node->desc));
|
||||
}
|
||||
}
|
||||
cfg->cb_printf ("%20s: %s\n", node->name, r_str_get (node->desc));
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
found = false;
|
||||
r_list_foreach (cfg->nodes, iter, node) {
|
||||
if (!str || (str && (!strcmp (str, node->name)))) {
|
||||
found = true;
|
||||
cfg->cb_printf ("%s\n", r_str_get (node->desc));
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!found) {
|
||||
cfg->cb_printf ("Key not found. Try e??%s\n", str);
|
||||
}
|
||||
break;
|
||||
case 's':
|
||||
if (str && *str) {
|
||||
r_list_foreach (cfg->nodes, iter, node) {
|
||||
|
@ -420,7 +420,7 @@ static int cmd_eval(void *data, const char *input) {
|
||||
switch (input[1]) {
|
||||
case '\0': r_core_cmd_help (core, help_msg_e); break;
|
||||
case '?': r_config_list (core->config, input + 2, 2); break;
|
||||
default: r_config_list (core->config, input + 1, 2); break;
|
||||
default: r_config_list (core->config, input + 1, 3); break;
|
||||
}
|
||||
break;
|
||||
case 't': // "et"
|
||||
|
Loading…
Reference in New Issue
Block a user