You are here

function demo_drush_command in Demonstration site (Sandbox / Snapshot) 6

Implementation of hook_drush_command().

File

./demo.drush.inc, line 25

Code

function demo_drush_command() {

  /**
   * command to display status report
   */
  $items['demo-status'] = array(
    'callback' => 'demo_drush_status',
    'description' => 'Print default dump settings and last reset time.',
    'aliases' => array(
      'demo-st',
    ),
  );

  /**
   * command to create new snapshot
   */
  $items['demo-create'] = array(
    'callback' => 'demo_drush_create_snapshot',
    'description' => dt('Create a new snapshot with the given file name and description.'),
    'arguments' => array(
      'filename' => 'Required. SQL dump file name.',
      'description' => 'Optional. Enter a description for this snapshot.',
    ),
    'examples' => array(
      'To create a new snapshot' => 'drush demo-create snapshot-v1.0 "First version"',
    ),
    'aliases' => array(
      'demo-mk',
    ),
  );

  // TODO: For demo-create, use default file name when no dump file name is given (@see http://drupal.org/node/754798)

  /**
   * command to delete snapshot
   */
  $items['demo-delete'] = array(
    'callback' => 'demo_drush_delete_snapshot',
    'description' => dt('Delete a snapshot with the given file name.'),
    'arguments' => array(
      'filename' => 'Required. SQL dump file name.',
    ),
    'examples' => array(
      'To delete a snapshot' => 'drush demo-delete snapshot-v1.0',
    ),
    'aliases' => array(
      'demo-rm',
    ),
  );

  /**
   * command to get a list of available snapshots
   */
  $items['demo-snapshots'] = array(
    'callback' => 'demo_drush_snapshots',
    'description' => 'Get a list of available snapshots.',
    'arguments' => array(
      'filename' => 'Optional. Name of the snapshot.',
    ),
    'examples' => array(
      'To get the list' => 'drush demo-snapshots',
      'To get description about individual snapshot' => 'drush demo-snapshot <snapshot-name>',
    ),
    'aliases' => array(
      'demo-ls',
    ),
  );

  /**
   * command to reset your site.
   */
  $items['demo-reset'] = array(
    'callback' => 'demo_drush_reset',
    'description' => 'Reset your site using a specified snapshot. DO NOT USE THIS COMMAND ON A PRODUCTION SERVER',
    'arguments' => array(
      'filename' => 'Required. SQL dump file name.',
    ),
    'examples' => array(
      'To reset use' => 'drush demo-reset snapshot-v1.0',
    ),
    'aliases' => array(
      'demo-rs',
    ),
  );
  return $items;
}