From 58ca6767bba55b732fcad08da8265b45578ba510 Mon Sep 17 00:00:00 2001
From: Greg Anderson <greg.1.anderson@greenknowe.org>
Date: Thu, 14 Feb 2013 10:11:30 -0800
Subject: Issue #1916356 by Greg Anderson, jonhattan, greg.1.anderson: Why
 does Google Analytics not show it's human name?

---
 commands/pm/pm.drush.inc |   11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/commands/pm/pm.drush.inc b/commands/pm/pm.drush.inc
index 59b4b88..8c083ae 100644
--- a/commands/pm/pm.drush.inc
+++ b/commands/pm/pm.drush.inc
@@ -508,12 +508,21 @@ function drush_get_projects(&$extensions = NULL) {
     $projects[$project]['extensions'][] = $extension->name;
   }
 
-  // Once we have all the extensions for each project, obtain projects' path.
+  // Obtain each project's path and try to provide a better label for ones
+  // with machine name.
   $reserved = array('modules', 'sites', 'themes');
   foreach ($projects as $name => $project) {
     if ($name == 'drupal') {
       continue;
     }
+
+    // If this project has no human label and it only contains an extension,
+    // construct a label based on the extension name.
+    if (($project['label'] == $name) && (count($project['extensions']) == 1)) {
+      $extension = $extensions[$project['extensions'][0]];
+      $projects[$name]['label'] = $extension->info['name'] .  ' (' . $name . ')';
+    }
+
     drush_log(dt('Obtaining !project project path.', array('!project' => $name)), 'debug');
     $path = _drush_pm_find_common_path($project['type'], $project['extensions']);
     // Prevent from setting a reserved path. For example it may happen in a case
-- 
1.7.9.5

