Skip to content

Commit

Permalink
Merging pull request #134
Browse files Browse the repository at this point in the history
Merge branch 'eiriksm-site_uuid_compact'
  • Loading branch information
mikevanwinkle committed Sep 19, 2014
2 parents 8a81222 + 09dfa11 commit 80d7d42
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 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 @@ -1907,6 +1910,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 @@ -4651,7 +4657,6 @@ function terminus_validate_hostname($hostname) {
return preg_match('/(?=^.{1,254}$)(^(?:(?!\d|-)[a-z0-9\-]{1,63}(?<!-)\.)+(?:[a-z]{2,})$)/i', $hostname);
}


/**
* Helper functions to validate input for a site_uuid.
*/
Expand Down

0 comments on commit 80d7d42

Please sign in to comment.