Skip to content

Show disabled commands with the reason why they were disabled #4035

@schlessera

Description

@schlessera

The hooks from #3835 are now in, and a simple type of dependency resolution should now work.

However, I'd like to look further into providing feedback like in this mockup about why a command might not be available:

commands-dependency-mockup

The before_add_command:<command> hook passes a WP_CLI\Dispatcher\CommandAddition object to the callback, which has an abort( $reason ) method.

I'm thinking about adding a new command object for this, something like WP_CLI\Dispatcher\DisabledCommand. When preparing the help screen, we can then still cycle over all commands, but provide different output for the disabled ones. They should also not be available to be actually run.

What do you think?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions