Skip to content

Conversation

@DivInstance
Copy link

@DivInstance DivInstance commented Oct 5, 2025

Summary

This PR updates the root ? help in Radare2 to include a dynamic “Core plugins” section and removes the Lc entry. Users can now discover core plugin commands directly from the main help without relying on Lc.

Changes:

  • Modified libr/core/cmd_help.inc.c :
    • Removed Lc line from help_msg_root.
    • In cmd_help() for root ?, added a dynamic help block built from core->rcmd->plist :
      • Header: “Core plugins:”
      • Per plugin: [ ? ]

Rationale:

  • Listing core plugins directly in root help improves discoverability and keeps help consistent with the loaded plugin set.
  • Avoids duplicating a static Lc entry when the plugin list is readily available programmatically.

Testing:

  • Build: ./configure && make -j
  • Lint: sys/lint.sh

Impact:

  • Help output improvement only; no behavioral changes to command execution.
  • Deprecates the Lc row in root ? in favor of the inline dynamic list.

Resolves #23724

@trufae
Copy link
Collaborator

trufae commented Oct 5, 2025

the way to make core plugins visible shpuld be listing their help in the root help instead of exposing Lc in here imho. But we must find a fast way to make the commands created by core plugins available in their subcommands helps and thats the current blocker imho

@DivInstance
Copy link
Author

I agree with the direction. Instead of exposing Lc, I’ll surface core plugin help in the root ? and in the corresponding subcommand helps.

@DivInstance DivInstance changed the title help: add 'Lc' entry to root '?' help for core plugin discoverability help: show core plugins in root ‘?’ dynamically; remove ‘Lc’ entry Oct 6, 2025
Copy link
Collaborator

@trufae trufae left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the code assumes the plugin name is aligned with the commands provided in the plugin, which is not always correct. we probably need a way for core plugins to expose a help message or list of commands provided instead of relying on the name. also ideally those commands shuold be listed in the right help message. but the concern for this would be about performance when doing "?*"

{
RListIter *iter;
RCorePlugin *pl;
int count = 0;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just r_list_length() no need to iterate

// 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 */
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move all this into a separate function

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Append Lc root commands help in ? help message

2 participants