Improve help screens: show disabled commands with reason and add --full recursive help#6287
Draft
Improve help screens: show disabled commands with reason and add --full recursive help#6287
Conversation
- Show disabled commands in help listings with a '(disabled)' indicator instead of silently hiding them. This applies to both `wp help <cmd>` subcommand listings and `wp <cmd>` usage listings. - Add `--full` flag to `wp help` that recursively shows help for the command and all its non-disabled subcommands, separated by '---' dividers. Useful for a 'man page'-style view of all commands. - Refactor show_help() to extract get_help_as_string() helper for reuse. - Update Behat tests to reflect new disabled command behavior, and add new scenarios for both features. Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com> Agent-Logs-Url: https://github.com/wp-cli/wp-cli/sessions/7f17cb62-25d6-4243-902b-b91c72b3a439
Copilot
AI
changed the title
[WIP] Improve user experience of the help screens
Improve help screens: show disabled commands and add --full recursive help
Mar 22, 2026
This comment was marked as resolved.
This comment was marked as resolved.
Add get_command_disabled_reason() to Runner that returns the reason why a command is disabled (e.g. "from the config file") or false if it isn't. Refactor is_command_disabled() to delegate to this new method. Update render_subcommands() in Help_Command and show_usage() in CompositeCommand to display the reason: "(disabled: from the config file)" instead of just "(disabled)". Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com> Agent-Logs-Url: https://github.com/wp-cli/wp-cli/sessions/390953ed-6fff-4d07-8ddd-cba8679902e6
This comment was marked as resolved.
This comment was marked as resolved.
Copilot
AI
changed the title
Improve help screens: show disabled commands and add --full recursive help
Improve help screens: show disabled commands with reason and add --full recursive help
Mar 22, 2026
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Disabled commands were silently hidden from help listings, making it hard to understand why a command seemed to be missing. There was also no way to get a comprehensive view of all subcommands and their documentation in one place.
Changes
Show disabled commands with reason in help listings
CompositeCommand::show_usage()— disabled subcommands now appear with the reason appended rather than being omitted (affectswp core,wp db, etc.)Help_Command::render_subcommands()— theSUBCOMMANDSsection inwp help <cmd>now lists disabled commands at the end with the reason includedRunner::get_command_disabled_reason()— new method returning the reason why a command is disabled (e.g."from the config file") orfalseif it isn't;is_command_disabled()now delegates to itTrying to run or get detailed help on a disabled command still errors as before.
wp help --fullfor recursive help outputAdds a
--fullflag towp helpthat recursively outputs help for the specified command and all its non-disabled subcommands, separated by---dividers — a man-page-style overview of the entire command tree.Internal refactor
show_help()is now a thin wrapper around the extractedget_help_as_string()helper, whichget_help_full()uses to accumulate output before a single pager pass.Test updates
features/config.feature: updated assertions to verify(disabled: from the config file)appears in listingsfeatures/help.feature: new scenarios for disabled-command visibility with reason and--fullbehaviorOriginal prompt
📱 Kick off Copilot coding agent tasks wherever you are with GitHub Mobile, available on iOS and Android.