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

Add compact option to site-uuid. #134

Merged
merged 1 commit into from
Sep 19, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion terminus.drush.inc
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,9 @@ function terminus_drush_command() {
'examples' => array(
'drush psite-uuid mysite --nocache' => 'Get the UUID of your site.',
),
'options' => array(
'compact' => 'Output only uuid. Useful for scripting.',
),
'required-arguments' => TRUE,
'aliases' => array('psite-uuid'),
'bootstrap' => DRUSH_BOOTSTRAP_DRUSH,
Expand Down Expand Up @@ -1668,6 +1671,9 @@ function drush_terminus_pantheon_site_uuid() {
foreach ($site_names as $site_name) {
if ($site_uuid = terminus_get_site_uuid_by_name($site_name)) {
$output = $site_name . ': ' . $site_uuid;
if (drush_get_option('compact')) {
$output = $site_uuid;
}
}
else {
$output = dt('@site_name: No uuid found.', array('@site_name' => $site_name));
Expand Down Expand Up @@ -4404,4 +4410,4 @@ function terminus_validate_sites($json) {
*/
function terminus_validate_hostname($hostname) {
return preg_match('/(?=^.{1,254}$)(^(?:(?!\d|-)[a-z0-9\-]{1,63}(?<!-)\.)+(?:[a-z]{2,})$)/i', $hostname);
}
}