always populate parsed arguments with default values#97
always populate parsed arguments with default values#97danielbachhuber merged 1 commit intowp-cli:masterfrom
Conversation
|
@acburdine Because I'm (still) new to the codebase, can you provide an extended description of how this changes the behavior, with before and after examples and any backwards compatibility / breaking change concerns? I appreciate you taking the time to put together this pull request. Just want to make sure I understand the full implications of what I'd be merging, and how it will impact existing users of the project. |
|
+1, as i see there is only 1 added method, which is triggered on $arguments->parse() (it is called after arguments definitions). This method fills the $argument array with default values (if these values are set in definitions). As i see, this also fixes the situation when default value is set to 0, becouse it does not pass the empty() function, but the true is that 0 is also value, so its needed to fill the $arguments array even if some arg is set to 0. These changes are backward compatible, becouse it only adds the funcionality. It can cause only fill $arguments array by default values, which is very useful. |
|
@danielbachhuber ^ what he said. Apologies for not responding to this sooner, I had a response written out in the Github reply box and then I accidentally clicked on a new tab and the typed-out response disappeared 😕 |
|
Cool, let's I'll be tagging a release in ~3 weeks (aligned with the next release of WP-CLI), if you want to try to land any more improvements between now and then. |
|
@acburdine Looks like the build failed on merge (and I didn't notice the pull request wasn't built): https://travis-ci.org/wp-cli/php-cli-tools/jobs/141764499 Mind tracking the issue down? |
|
Huh, I thought I'd fixed the test issues. Will take a look 😄 |
closes #30