From 8f270ae1786001095d3c02b51cac97008920667f Mon Sep 17 00:00:00 2001
From: Mark Sonnabaum <mark@sonnabaum.com>
Date: Fri, 25 Feb 2011 20:08:13 -0600
Subject: [PATCH] Issue #1073476 msonnabaum: Updated dl to download a project instead of
 prompting if there is only one choice.

---
 commands/pm/pm.drush.inc |   14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)

diff --git commands/pm/pm.drush.inc commands/pm/pm.drush.inc
index e39096a..9fdec1e 100644
--- commands/pm/pm.drush.inc
+++ commands/pm/pm.drush.inc
@@ -1753,12 +1753,18 @@ function pm_parse_release($request, $xml) {
       drush_print(dt('There is no !type release for project !project.', array('!type' => $release_type, '!project' => $request['name'])));
     }
     $options = _drush_pm_download_releases_choice($xml, $request['name'], drush_get_option('all', FALSE), drush_get_option('dev', FALSE));
-    $choice = drush_choice($options, dt('Choose one of the available releases:'));
-    if ($choice) {
-      $releases = $xml->xpath("/project/releases/release[status='published'][version='" . $choice . "']");
+    if (count($options) === 1) {
+      $version = array_keys($options);
+      $releases = $xml->xpath("/project/releases/release[status='published'][version='" . $version[0]. "']");
     }
     else {
-      return FALSE;
+      $choice = drush_choice($options, dt('Choose one of the available releases:'));
+      if ($choice) {
+        $releases = $xml->xpath("/project/releases/release[status='published'][version='" . $choice . "']");
+      }
+      else {
+        return FALSE;
+      }
     }
   }
 
-- 
1.7.4.1

