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
English syntax/logic error in wp-cli output message(s) #5803
Comments
Hi |
|
I'll try to sort this at WCEU23. |
There are two issues being described here, both of which are covered by this code. I'm unable to replicate the first issue, and I disagree with the suggestion in the second issue, as detailed below: Issue 1. Should never use the word "Only" after success, e.g. "Error: Only 2 of 2 plugins updated."
Unable to replicate. I've managed to produce messages of the form For speed, I also tried creating and deleting menus, which uses the same display code but executes faster than plugin updates. Here are my test cases: wp menu create "Alpha"
wp menu create "Beta"
wp menu delete "Alpha" "Beta" (correctly outputs wp menu create "Gamma"
wp menu delete "Gamma" "Delta" (correctly outputs @abilicom: are you able to provide a test scenario that consistently produces output of the type "Only X of Y..." where X=Y? Issue 2. Should never use the word "Only" at all
I disagree. The wasted bytes (a tiny 5 extra bytes, assuming 8-bit ASCII encoding) are not significant compared to the benefits of retaining the word "Only", which include:
My recommendation: unless somebody else is able to replicate the "Only X of Y..." (where X=Y) bug, close this issue. |
Tagging my WCEU23 "handler" @janw-me to decide how best to proceed with the above. |
Whether the word is appropriate or grammatically correct, I don't know. But changing the output could break scripts. Therefore it's not unthinkable some scripts today might depend on the wording, @abilicom Are you able to (re)produce an output where "Only 2 of 2 plugins updated" appears? |
Hi!
This issue may seem trivial, but here it is for your consideration nonetheless.
When updating plugins, wp-cli outputs the following:
Error: Only updated x of y plugins.
(Where x is the quantity of plugins updated and 'y' us the quantity of plugins marked as having an available update.)This is improper usage of the English word "Only." The use of "only" in this scenario infers that some plugins were not updated, but is sent even though all plugins were updated. Example:
Error: Only 2 of 2 plugins updated
(x = y)This is the context in which it should be used:
All plugins updated: -> "[Error:] 2 of 2 plugins updated." ("Only" suppressed when x = y)
Some of many plugins updated -> "[Error:] Only 2 of 9 plugins updated." ("Only" only sent when not all available plugins are updated, for any reason, x < y.)
Personally, I would recommend that the use of the word 'only' just be omitted altogether (in all scenarios), it's use is implied when needed; wastes bytes.
Regards,
Brian
The text was updated successfully, but these errors were encountered: