-
Notifications
You must be signed in to change notification settings - Fork 975
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
Shouldn't a warning result in a return code ($?) higher then zero? #1430
Comments
Related #1415 Same consideration applies though: WP-CLI supports deactivating multiple plugins at once. Interested to hear your opinions on what WP-CLI should do. |
Hi Daniel, Thanx for your reply. After going through my memory archive :) ... Hereby my feedback. Hope it helps. Rough pointers
There's probably never 25 different DB issues, but you get the idea. More on the actual level (and ranges). It's mainly to combine errors, so when having a funky WP installation that results in an error 27 and you find a certain db connect issue e.g. 56 at the same time. The return level should be 83. Hence the bitwise operator Might be to elaborate, but I'm writing a wrapper between saltstack and wp-cli .. so I wouldn't mind 😜 Update allUsually the return codes represent distinct levels and not an approximation. So ... As far as the plugins and especially the "update all" goes. Consider changing “all" into "all (updates) available” even it it’s just by definition and not actually renaming the the parameter or sub command. Therewith the more updates that failed the higher the return code. Possibly choose a reserved range to your liking e.g. between 100 and 150), and count the failed updates. So when "update all" run on a WP instance that has 25 plugins of which 12 avail updates. return 100 when all goes well (well zero then actually) and 1 higher for all failed. You should of course mention the amount of failed plugin updates to the user and not the error level visibly, but this way the distinction can be properly caught at least. Oh, and yield breakage number till all updates are executed, and then return the error. .. I think is good. I would like a 'whiteboard session' whether it's good or not to relate the amount of succeeded updates to a distinct error level, but it's a start 😄 This is the first I can come up with. I hope it helps. Kind regards, Gerard. |
I think a good place to look for inspiration would be package managers, like |
Note that the most reliable way to check the results is by running |
@scribu: Good point on the apt-get! 👍 On the review afterwards ... I do that with Salt commands as well when 'apt updating' my servers, however that does mean 'human interpretation' of the output. Using the 'wp plugin list' command after a (distributed and thus unattended) update implies saving state somewhere. So the before and after picture can be compared. Not an issues as such but something to keep in mind while designing the setup. At least in my case 😉 Good'day |
Related to this - even in the case when doing a |
Contradiction we need to solve:
|
Working on a Wordpress plugin that enables some new wp-cli commands .. I just noticed in the API docs:
(ref: https://github.com/wp-cli/wp-cli/wiki/API) This suggests an actual return code ... Is the documentation erroneous or did I mis somehting 😃 Ta! |
How about a |
wp plugin uninstall $active_plugin should return something else than 0 … |
For those subscribed to this thread, I've posted a RFC on changing the behavior #3577 |
This is being addressed by #3577 |
Hi All,
I'm working on some wrapper software and noticed a wrong return code on the commandline:
Shouldn't it produce an errorlevel higher then zero or am I missing something?
Thanx a lot.
Kind regards,
Gerard.
The text was updated successfully, but these errors were encountered: