Improve support for cases with empty --path provided to wp-cli commands#5709
Merged
danielbachhuber merged 8 commits intowp-cli:mainfrom Dec 7, 2022
Merged
Improve support for cases with empty --path provided to wp-cli commands#5709danielbachhuber merged 8 commits intowp-cli:mainfrom
danielbachhuber merged 8 commits intowp-cli:mainfrom
Conversation
wojtekn
commented
Dec 5, 2022
Member
danielbachhuber
left a comment
There was a problem hiding this comment.
Thanks @wojtekn !
Can you write some functional tests for this change?
The handbook is editable if there are improvements you identify.
Contributor
Author
|
@danielbachhuber that is good idea, I've added functional tests for three cases. |
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.
I propose fixing the confusing messaging we show if an empty
--pathparameter is provided to command calls.The empty parameter is considered a
trueflag, let's treat it as empty path:This is also an empty parameter considered a
trueflag because there is no equal sign used to assign a path to the parameter. Let's treat it as an empty path too:Then handle an empty string as an empty path:
When a non-empty path is provided, include the full working directory in the error message:
Fixes: #5559