? 720580-drush-1.patch
Index: includes/backup_migrate.drush.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/backup_migrate/includes/backup_migrate.drush.inc,v
retrieving revision 1.1.2.3
diff -u -p -r1.1.2.3 backup_migrate.drush.inc
--- includes/backup_migrate.drush.inc	27 Oct 2009 02:50:08 -0000	1.1.2.3
+++ includes/backup_migrate.drush.inc	23 Feb 2010 22:59:15 -0000
@@ -11,46 +11,43 @@
  * Implementation of hook_drush_command().
  */
 function backup_migrate_drush_command() {
-  $items['bam backup'] = array(
+  $items['bam-backup'] = array(
     'callback' => 'backup_migrate_drush_backup',
     'description' => dt('Backup the site\'s database with Backup and Migrate.'),
     'examples' => array(
-      'drush bam backup' => 'Backup the default databse to the manual backup directory using the default settings.', 
-      'drush bam backup db scheduled mysettings' => 'Backup the database to the scheduled directory using a settings profile called "mysettings"', 
-      'drush bam backup files' => 'Backup the files directory to the manual directory using the default settings. The Backup and Migrate Files module is required for files backups.', 
+      'drush bam-backup' => 'Backup the default databse to the manual backup directory using the default settings.', 
+      'drush bam-backup db scheduled mysettings' => 'Backup the database to the scheduled directory using a settings profile called "mysettings"', 
+      'drush bam-backup files' => 'Backup the files directory to the manual directory using the default settings. The Backup and Migrate Files module is required for files backups.', 
     ),
     'arguments' => array(
-      'source'        => "Optional. The id of the source (usually a database) to backup. Use 'drush bam sources' to get a list of sources. Defaults to 'db'",
-      'destination'   => "Optional. The id of destination to send the backup file to. Use 'drush bam destinations' to get a list of destinations. Defaults to 'manual'",
-      'profile'       => "Optional. The id of a settings profile to use. Use 'drush bam profiles' to get a list of available profiles. Defaults to 'default'",
+      'source'        => "Optional. The id of the source (usually a database) to backup. Use 'drush bam-sources' to get a list of sources. Defaults to 'db'",
+      'destination'   => "Optional. The id of destination to send the backup file to. Use 'drush bam-destinations' to get a list of destinations. Defaults to 'manual'",
+      'profile'       => "Optional. The id of a settings profile to use. Use 'drush bam-profiles' to get a list of available profiles. Defaults to 'default'",
     ),
   );
-  $items['bam restore'] = array(
+  $items['bam-restore'] = array(
     'callback' => 'backup_migrate_drush_restore',
     'description' => dt('Restore the site\'s database with Backup and Migrate.'),
     'arguments' => array(
-      'source'        => "Required. The id of the source (usually a database) to restore the backup to. Use 'drush bam sources' to get a list of sources. Defaults to 'db'",
-      'destination'   => "Required. The id of destination to send the backup file to. Use 'drush bam destinations' to get a list of destinations. Defaults to 'manual'",
-      'backup id'     => "Required. The id of a backup file restore. Use 'drush bam backups' to get a list of available backup files.",
+      'source'        => "Required. The id of the source (usually a database) to restore the backup to. Use 'drush bam-sources' to get a list of sources. Defaults to 'db'",
+      'destination'   => "Required. The id of destination to send the backup file to. Use 'drush bam-destinations' to get a list of destinations. Defaults to 'manual'",
+      'backup id'     => "Required. The id of a backup file restore. Use 'drush bam-backups' to get a list of available backup files.",
     ),
   );
-  $items['bam destinations'] = array(
-    'callback' => 'backup_migrate_drush_destinations',
-    'description' => dt('Get a list of available destinations.'),
-  );
-  $items['bam sources'] = array(
+  $items['bam-destinations'] = arraybam-restore;
+  $items['bam-sources'] = array(
     'callback' => 'backup_migrate_drush_sources',
     'description' => dt('Get a list of available sources.'),
   );
-  $items['bam profiles'] = array(
+  $items['bam-profiles'] = array(
     'callback' => 'backup_migrate_drush_profiles',
     'description' => dt('Get a list of available settings profiles.'),
   );
-  $items['bam backups'] = array(
+  $items['bam-backups'] = array(
     'callback' => 'backup_migrate_drush_destination_files',
     'description' => dt('Get a list of previously created backup files.'),
     'arguments' => array(
-      'destination'   => "Required. The id of destination to list backups from. Use 'drush bam destinations' to get a list of destinations.",
+      'destination'   => "Required. The id of destination to list backups from. Use 'drush bam-destinations' to get a list of destinations.",
     ),
   );
   return $items;
@@ -61,15 +58,15 @@ function backup_migrate_drush_command() 
  */
 function backup_migrate_drush_help($section) {
   switch ($section) {
-    case 'drush:bam backup':
+    case 'drush:bam-backup':
       return dt("Backup the site's database using default settings.");
-    case 'drush:bam restore':
+    case 'drush:bam-restore':
       return dt('Restore the site\'s database with Backup and Migrate.');
-    case 'drush:bam destinations':
+    case 'drush:bam-destinations':
       return dt('Get a list of available destinations.');
-    case 'drush:bam profiles':
+    case 'drush:bam-profiles':
       return dt('Get a list of available settings profiles.');
-    case 'drush:bam backups':
+    case 'drush:bam-backups':
       return dt('Get a list of previously created backup files.');
   }
 }
@@ -84,16 +81,16 @@ function backup_migrate_drush_backup($so
   _backup_migrate_message_callback('_backup_migrate_message_drush');
 
   if (!backup_migrate_get_destination($source_id)) {
-    _backup_migrate_message("Could not find the source '@source'. Try using 'drush bam sources' to get a list of available sources or use 'db' to backup the Drupal database.", array('@source' => $source_id), 'error');
+    _backup_migrate_message("Could not find the source '@source'. Try using 'drush bam-sources' to get a list of available sources or use 'db' to backup the Drupal database.", array('@source' => $source_id), 'error');
     return;
   }
   if (!backup_migrate_get_destination($destination_id)) {
-    _backup_migrate_message("Could not find the destination '@destination'. Try using 'drush bam destinations' to get a list of available destinations.", array('@destination' => $destination_id), 'error');
+    _backup_migrate_message("Could not find the destination '@destination'. Try using 'drush bam-destinations' to get a list of available destinations.", array('@destination' => $destination_id), 'error');
     return;
   }
   $settings = backup_migrate_get_profile($profile_id);
   if(!$settings) {
-    _backup_migrate_message("Could not find the profile '@profile'. Try using 'drush bam profiles' to get a list of available profiles.", array('@profile' => $profile_id), 'error');
+    _backup_migrate_message("Could not find the profile '@profile'. Try using 'drush bam-profiles' to get a list of available profiles.", array('@profile' => $profile_id), 'error');
     return;
   }
 
@@ -113,15 +110,15 @@ function backup_migrate_drush_restore($s
   _backup_migrate_message_callback('_backup_migrate_message_drush');
 
   if (!backup_migrate_get_destination($source_id)) {
-    _backup_migrate_message("Could not find the source '@source'. Try using 'drush bam sources' to get a list of available sources or use 'db' to backup the Drupal database.", array('@source' => $source_id), 'error');
+    _backup_migrate_message("Could not find the source '@source'. Try using 'drush bam-sources' to get a list of available sources or use 'db' to backup the Drupal database.", array('@source' => $source_id), 'error');
     return;
   }
   if (!$destination = backup_migrate_get_destination($destination_id)) {
-    _backup_migrate_message("Could not find the destination '@destination'. Try using 'drush bam destinations' to get a list of available destinations.", array('@destination' => $destination_id), 'error');
+    _backup_migrate_message("Could not find the destination '@destination'. Try using 'drush bam-destinations' to get a list of available destinations.", array('@destination' => $destination_id), 'error');
     return;
   }
   if (!$file_id || !$file = backup_migrate_destination_get_file($destination_id, $file_id)) {
-    _backup_migrate_message("Could not find the file '@file'. Try using 'drush bam backups @destination' to get a list of available backup files in this destination destinations.", array('@destination' => $destination_id, '@file' => $file_id), 'error');
+    _backup_migrate_message("Could not find the file '@file'. Try using 'drush bam-backups @destination' to get a list of available backup files in this destination destinations.", array('@destination' => $destination_id, '@file' => $file_id), 'error');
     return;
   }
 
@@ -186,11 +183,11 @@ function backup_migrate_drush_destinatio
   _backup_migrate_message_callback('_backup_migrate_message_drush');
 
   if (!$destination_id) {
-    _backup_migrate_message("You must specify an existing destination. Try using 'drush bam destinations' to get a list of available destinations.", array('@destination' => $destination_id), 'error');
+    _backup_migrate_message("You must specify an existing destination. Try using 'drush bam-destinations' to get a list of available destinations.", array('@destination' => $destination_id), 'error');
     return;
   }
   if (!$destination = backup_migrate_get_destination($destination_id)) {
-    _backup_migrate_message("Could not find the destination '@destination'. Try using 'drush bam destinations' to get a list of available destinations.", array('@destination' => $destination_id), 'error');
+    _backup_migrate_message("Could not find the destination '@destination'. Try using 'drush bam-destinations' to get a list of available destinations.", array('@destination' => $destination_id), 'error');
     return;
   }
 
