Skip to content
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

AL-797 - Refined help text #1563

Merged
merged 2 commits into from
Jan 27, 2017
Merged

AL-797 - Refined help text #1563

merged 2 commits into from
Jan 27, 2017

Conversation

TeslaDethray
Copy link
Contributor

No description provided.

@TeslaDethray TeslaDethray added this to the 1.0.1 milestone Jan 26, 2017
@TeslaDethray TeslaDethray self-assigned this Jan 26, 2017
@TeslaDethray TeslaDethray force-pushed the change/element_help_text branch 8 times, most recently from ee30070 to a3ec106 Compare January 27, 2017 00:05
*
* @usage <site>.<env> Lists all backups made of <site>'s <env> environment.
* @usage <site>.<env> --element=<element> Lists all <element> backups made of <site>'s <env> environment.
*/
public function listBackups($site_env, $element = 'all')
public function listBackups($site_env, array $options = ['element' => 'all',])
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is something we missed: all the other backup commands use element as an option (and rightfully so because it's optional, even here) but backup:list has it as a parameter. I would like to change it to an option.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.01%) to 89.729% when pulling 750c44b on change/element_help_text into 3ebc2bf on master.

@TeslaDethray TeslaDethray force-pushed the change/element_help_text branch 2 times, most recently from 639dad1 to 0e93dee Compare January 27, 2017 19:29
@@ -37,14 +33,14 @@ class GetCommand extends TerminusCommand implements SiteAwareInterface, RequestA
* @usage <site>.<env> --to=<path> Saves the most recent backup of any type in <site>'s <env> environment to <path>.
* @usage <site>.<env> --to=<path> Saves the most recent <element> backup in <site>'s <env> environment to <path>.
*/
public function getBackup($site_env, array $options = ['file' => null, 'element' => null, 'to' => null,])
public function getBackup($site_env, array $options = ['file' => null, 'element' => 'all', 'to' => null,])
Copy link
Contributor Author

@TeslaDethray TeslaDethray Jan 27, 2017

Choose a reason for hiding this comment

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

Re our convo @alexfornuto By using the 'element' => 'all' here, the underlying software we're using picks it up and adds it to the help output.
image

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.03%) to 89.706% when pulling 53d322b on change/element_help_text into 3ebc2bf on master.

@TeslaDethray TeslaDethray changed the title Refined help text for backup element options AL-797 - Refined help text Jan 27, 2017
* @param string $element
* @return null|string
*/
protected function getElement($element)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Q: Can I just validate the element option?

@ronan
Copy link
Contributor

ronan commented Jan 27, 2017

This looks fine to me although it leaves some weird undefined behavior when element is sent as an arg and an option. If it were me I'd break bc in favor of maintainable and understandable behavior. I get the semver promise argument though so....

+1

@TeslaDethray
Copy link
Contributor Author

I mean for it to always prefer the option, as it is not deprecated. If the option is simply default, it will accept whatever the parameter has in it. I wanted running scripts w/o the option to run smoothly. I'll note this in a comment.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.03%) to 89.706% when pulling fae7e76 on change/element_help_text into 3ebc2bf on master.

@TeslaDethray TeslaDethray merged commit f840c33 into master Jan 27, 2017
@TeslaDethray TeslaDethray deleted the change/element_help_text branch January 27, 2017 22:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants