Index: drush/module_builder.drush.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/module_builder/drush/Attic/module_builder.drush.inc,v
retrieving revision 1.1.2.58
diff -u -p -r1.1.2.58 module_builder.drush.inc
--- drush/module_builder.drush.inc	19 Jan 2010 13:21:16 -0000	1.1.2.58
+++ drush/module_builder.drush.inc	27 Jun 2010 11:05:52 -0000
@@ -228,20 +230,62 @@ function module_builder_callback_build()
  * Helper function to build the array of module_data.
  */
 function module_builder_build_data($commands) {
-  // The first argument is the module machine name.
-  $module_data['module_root_name'] = array_shift($commands);  
-  
   // Heap of defaults. Later find some nice way of asking for these. 
   //$data['module_readable_name'] = ucfirst($data['module_root_name']);
   //$data['module_short_description'] = 'Description';
   // todo: some function in common.inc to set defaults?
-  
-  $module_data['module_readable_name']     = drush_get_option('name');
-  $module_data['module_short_description'] = drush_get_option('desc');
-  $module_data['module_help_text']         = drush_get_option('help');
-  $module_data['module_dependencies']      = drush_get_option('dep');
-  $module_data['module_package']           = drush_get_option('package');
-  
+
+  $data = array(
+    'module_root_name' => array(
+      'prompt' => dt('module name'),
+      'optional'=> FALSE,
+    ),
+    'module_readable_name' => array(
+      'key' => 'name',
+      'prompt' => dt('human readable name'),
+      'optional'=> FALSE,
+    ),
+    'module_short_description' => array(
+      'key' => 'desc',
+      'prompt' => dt('description'),
+    ),
+    'module_help_text' => array(
+      'key' => 'help',
+      'prompt' => dt('help text'),
+    ),
+    'module_dependencies' => array(
+      'key' => 'dep',
+      'prompt' => dt('dependencies'),
+    ),
+    'module_package' => array(
+      'key' => 'package',
+      'prompt' => dt('package'),
+    ),
+  );
+
+  foreach ($data as $name => $definition) {
+    $definition += array(
+      'optional' => TRUE,
+    );
+    if (isset($definition['key'])) {
+      $module_data[$name] = drush_get_option($definition['key']);
+    }
+    else {
+      // The first argument is the module machine name.
+      $module_data[$name] = array_shift($commands);
+    }
+
+    if (empty($module_data[$name])) {
+      $value = drush_prompt(dt('Enter the @type', array('@type' => $definition['prompt'])), NULL, $definition['optional']);
+      if ($value !== FALSE) {
+        $module_data[$name] = $value;
+      }
+      else {
+        unset($module_data[$name]);
+      }
+    }
+  }
+
   return $module_data;
 }
 
@@ -260,7 +304,10 @@ function module_builder_build_data($comm
 function module_builder_callback_module($commands, &$module_data, $build_list) {
   // The first argument is the module machine name.
   array_shift($commands);  
-    
+
+  if (empty($commands)) {
+    $commands = explode(" ", drush_prompt(dt('Enter available hooks')));
+  }
   foreach ($commands as $hook_name) {
     $module_data['hooks']["hook_$hook_name"] = TRUE;    
   }
