-
Notifications
You must be signed in to change notification settings - Fork 1k
Differentiate commands and namespace #5069
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
Differentiate commands and namespace #5069
Conversation
php/class-wp-cli.php
Outdated
| if ( ! empty( $parent ) ) { | ||
| $sub_command = trim( str_replace( $parent, '', $name ) ); | ||
| self::debug( "Adding command: {$sub_command} in {$parent} Namespace", 'commands' ); | ||
| self::debug( "Adding namespace: {$parent}", 'commands' ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This message needs to be displayed when the actual namespace object is being added, otherwise it serves no purpose.
To check whether a command to be added is a namespace, you can use:
if ( $leaf_command instanceof Dispatcher\CommandNamespace ) { }There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright, I thought this was week like make none sense what I did, but perhaps with the condition of instanceof perhaps makes more sense. I'll correct it for today.
|
@killua99 Still interested in picking this up? Is something unclear about what the intended outcome should be? |
|
Hi @schlessera sorry for delay this issue for so long, I've been committing patches in other place. I would say, if anyone want to bring a patch for it, then it should be submit the path. I would do it just idk when if this week or the next one. Is clear to me the scope of the issue and what the outcome should be. Let's see if I've time for it soon™ |
|
I'm not quite sure how to really debug or test the debug flag here. Which situation would have such of thing? @schlessera |
|
@killua99 An example of where this is being used is the
|
|
This was fixed via #5563 |
|
Thanks for the effort in creating this PR, @killua99 ! |
--debug showing a message to differentiate the namespace from the command.
Resolve: #4937