New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Not possible to add subcommand for db
#5694
Comments
Thanks for the report, @tyrann0us !
This seems to work for me:
How are you calling the file with your |
Hi @danielbachhuber, thanks for getting back to me.
For testing purposes, I had wrapped the command in a plugin (basically just the PHP class with a plugin header on top of it, living in I can't judge whether the differences in adding subcommands to e.g. Thanks! |
@tyrann0us With issues like this, it is usually a matter of timing. If you use the Also, given that the |
I'm closing this, as I assume it works as expected. Feel free to reopn, @tyrann0us, incase you still think there is something off. |
Bug Report
Describe the current, buggy behavior
Adding a custom subcommand of a native command with
WP_CLI::add_command()
works fine, except at least for thedb
command.Describe how other contributors can replicate this bug
db
command (see code snippet below)Adding a subcommand for
core
:Adding a subcommand for
db
:Describe what you expect as the correct outcome
The subcommand works, outputting "Success: foo".
Let us know what environment you are running this on
(This is DDEV v1.21.2 on macOS 11.7.)
Provide additional context/screenshots
I haven't tested all native commands if adding subcommands works.
The text was updated successfully, but these errors were encountered: