Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions libr/core/cmd_help.inc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1721,6 +1721,40 @@ static int cmd_help(void *data, const char *input) {
// TODO #7967 help refactor
r_core_cmd_help (core, help_msg_intro);
r_core_cmd_help (core, help_msg_root);
/* Dynamically list core plugins in root help */
{
RListIter *iter;
RCorePlugin *pl;
int count = 0;
if (core->rcmd && core->rcmd->plist) {
/* count plugins */
r_list_foreach (core->rcmd->plist, iter, pl) {
count++;
}
}
if (count > 0) {
int items = 3 + (count * 3) + 1;
const char **help = (const char **)malloc (items * sizeof (char*));
if (help) {
int idx = 0;
help[idx++] = "Core plugins:";
help[idx++] = "";
help[idx++] = "";
if (core->rcmd && core->rcmd->plist) {
r_list_foreach (core->rcmd->plist, iter, pl) {
const char *name = pl->meta.name? pl->meta.name: "";
const char *desc = pl->meta.desc? pl->meta.desc: "";
help[idx++] = name;
help[idx++] = "[?]";
help[idx++] = desc;
}
}
help[idx++] = NULL;
r_core_cmd_help (core, help);
free ((void*)help);
}
}
}
break;
default:
r_core_return_invalid_command (core, "?", input[0]);
Expand Down