Skip to content

Conversation

@BhargavBhandari90
Copy link
Contributor

Fixes #353

  • Currently, I've displayed an error message when an argument is missing.

@BhargavBhandari90 BhargavBhandari90 requested a review from a team as a code owner September 11, 2022 09:49
@BhargavBhandari90 BhargavBhandari90 changed the title WIP: Issue #353 : Show error when parameter missing in patch command Issue #353 : Show error when parameter missing in patch command Sep 11, 2022
"""
Please provide value to update.
"""
And the return code should be 1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add a test case for:

When I run `wp option patch update option_name foo 0`

To make sure we're handling falsy values correctly?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should not allow this to update, right?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should not allow this to update, right?

Perhaps I'm misunderstanding but isn't 0 a valid value?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, I misunderstood.

I thought zero should be considered an empty value.

Then I saw other commands in the same option-pluck-patch.feature file.

So fixe it.

@danielbachhuber danielbachhuber changed the title Issue #353 : Show error when parameter missing in patch command Show error when parameter is missing in wp option patch Sep 12, 2022
@danielbachhuber danielbachhuber added this to the 2.3.2 milestone Sep 12, 2022
@danielbachhuber danielbachhuber added bug command:option Related to 'option' command command:option-patch Related to 'option patch' command labels Sep 12, 2022
@danielbachhuber danielbachhuber self-requested a review September 12, 2022 16:27
Copy link
Member

@danielbachhuber danielbachhuber left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the updates!

@danielbachhuber danielbachhuber merged commit ea6b608 into wp-cli:master Sep 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug command:option Related to 'option' command command:option-patch Related to 'option patch' command

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Missing argument with option patch update should throw error

3 participants