-
Notifications
You must be signed in to change notification settings - Fork 196
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
Conversation
ee30070
to
a3ec106
Compare
* | ||
* @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',]) |
There was a problem hiding this comment.
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.
a3ec106
to
adfc97b
Compare
639dad1
to
0e93dee
Compare
@@ -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,]) |
There was a problem hiding this comment.
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.
0e93dee
to
2572963
Compare
* @param string $element | ||
* @return null|string | ||
*/ | ||
protected function getElement($element) |
There was a problem hiding this comment.
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?
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 |
53d322b
to
bdaa45b
Compare
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. |
bdaa45b
to
fae7e76
Compare
No description provided.