Using Drush 3.0-rc1, I get this notice:

Notice: "import manager list" must be renamed to "import-manager-list" in order to work with this version of drush. If[error]
you are the maintainer for the module that defines this command, please rename it immediately. If you are a user of
this command, you may enable spaces in commands for a while by setting "allow-spaces-in-commands" in your drush
configuration file. See example.drushrc.php.

Rather than doing a patch, here's an updated drush.inc file:

// $Id: import_manager.drush.inc,v 1.1 2009/07/22 22:17:54 drumm Exp $

function import_manager_drush_help($section) {
  switch ($section) {
    case 'drush:import-manager-list':
      return dt('List available imports.');

    case 'drush:import-manager-run':
      return dt('Run an import.');
  }
}

function import_manager_drush_command() {
  return array(
    'import-manager-list' => array(
      'callback' => 'import_manager_drush_list',
      'description' => 'List available imports.',
      'arguments' => array(
        '[module]' => 'Optional module name.',
      ),
    ),
    'import-manager-run' => array(
      'callback' => 'import_manager_drush_run',
      'description' => 'Run an import.',
      'arguments' => array(
        'function' => 'Function to run.',
        '[...]' => 'Additional arguments.',
      ),
    ),
  );
}

function import_manager_drush_list($module = NULL) {
  if (is_null($module)) {
    $modules = module_implements('imports');
  }
  else {
    $modules = array($module);
  }
  foreach ($modules as $module) {
    $info = drupal_parse_info_file(drupal_get_path('module', $module) .'/'. $module .'.info');
    foreach (module_invoke($module, 'imports') as $name => $group) {
      drush_print('');
      drush_print($info['name'] . ' - ' . $name);
      $functions = array();
      foreach ($group as $function => $options) {
        $functions[] = array(
          $function,
          $options['title'],
        );
      }
      drush_print_table($functions);
    }
  }
}

function import_manager_drush_run() {
  $args = func_get_args();
  $function = array_shift($args);
  import_manager_run($function, $args);
}

Comments

kentr’s picture

Status: Active » Needs review
asherry’s picture

Status: Needs review » Closed (outdated)

I'm going to close this out as it's one of the oldest issues I have, and it doesn't seem like it's even necessary. I'm also going to update the module status too.