Skip to content
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

Avoid double registration of commands #5193

Merged
merged 1 commit into from Apr 24, 2019

Conversation

@schlessera
Copy link
Member

commented Apr 24, 2019

When a given subcommand is already found:

  • if it is a command namespace, we replace it with the new command, and attach all children of the namespace to the new command.
  • if it is a regular command, we skip registration, to avoid double registration. This means only the first registration counts (making overrides through packages and requires precede bundled commands).

Fixes #5186

Avoid double registration of commands
When a given subcommand is already found:
- if it is a command namespace, we replace it with the new command, and attach all children of the namespace to the new command.
- if it is a regular command, we skip registration, to avoid double registration. This means only the first registration counts (making overrides through packages and requires precede bundled commands).

Fixes #5186

@schlessera schlessera requested a review from wp-cli/committers as a code owner Apr 24, 2019

@schlessera schlessera added this to the 2.2.0 milestone Apr 24, 2019

@schlessera schlessera merged commit 4fc55f4 into master Apr 24, 2019

2 checks passed

DEP All dependencies are resolved
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@delete-merged-branch delete-merged-branch bot deleted the 5186-avoid-double-registration-of-commands branch Apr 24, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants
You can’t perform that action at this time.