function tripal_core_drush_command

2.x tripal_core.drush.inc tripal_core_drush_command()
3.x tripal_core.drush.inc tripal_core_drush_command()
1.x tripal_core.drush.inc tripal_core_drush_command()

Registers a drush command and constructs the full help for that command.

Return value

And array of command descriptions

Related topics

File

tripal_core/tripal_core.drush.inc, line 79
Contains function relating to drush-integration of this module.

Code

function tripal_core_drush_command() {
  $items = array();

  $items['trp-refresh-mview'] = array(
    'description' => dt('Refreshes the contents of the specified materialized view.'),
    'arguments' => array(),
    'examples' => array(
      'By Materialized View ID' => 'drush trp-refresh-mview --mview=5',
      'By Table Name' => 'drush trp-refresh-mview --table=organism_feature_count'
    ),
    'options' => array(
      'mview' => dt('The ID of the materialized view to update'),
      'table' => dt('The name of the materialized view table to update.'),
    ),
  );
  $items['trp-get-currjob'] = array(
    'description' => dt('Returns details about the currently running job including percent complete.'),
    'arguments' => array(),
    'examples' => array(
      'Standard example' => 'drush trp-get-currjob',
    ),
  );
  $items['trp-run-jobs'] = array(
    'description' => dt('Launches jobs waiting in the queue. Only one job can execute at a time unless the --parllel=1 option is provided.'),
    'examples' => array(
      'Single Job' => 'drush trp-run-jobs --username=administrator',
      'Parallel Job' => 'drush trp-run-jobs --username=administrator --parallel=1',
      'Max-jobs Job' => 'drush trp-run-jobs --username=administrator --parallel=1 --max_jobs=10',
    ),
    'arguments' => array(),
    'options' => array(
      'user' => array(
        'description' => dt('DEPRECATED. Conflicts with Drush 7.x --user argument. Please use the --username argument.'),
      ),
      'username' => array(
        'description' => dt('The Drupal user name for which the job should be run.  The permissions for this user will be used.'),
      ),
      'parallel' => dt('Normally jobs are executed one at a time. But if you are certain no conflicts will occur with other currently running jobs you may set this argument to a value of 1 to make the job run in parallel with other running jobs.'),
      'job_id' => dt('Provide a job_id to run a specific job. Only jobs that have not been run already can be used'),
      'max_jobs' => dt('Indicate the maximum number of concurrent jobs. Default is -1 (unlimited). Ignore if not running parallel jobs'),
      'single' => dt('Execute only one queued job'),
    ),
  );
  $items['trp-rerun-job'] = array(
    'description' => dt('Re-run a specific job from the queue.'),
    'examples' => array(
      'Single Job' => 'drush trp-rerun-job --username=administrator --job_id=2',
      'Parallel Job' => 'drush trp-rerun-job --username=administrator  --job_id=2 --parallel=1'
    ),
    'arguments' => array(),
    'options' => array(
      'user' => array(
        'description' => dt('DEPRECATED. Conflicts with Drush 7.x --user argument. Please use the --username argument.'),
      ),
      'username' => array(
        'description' => dt('The Drupal user name for which the job should be run.  The permissions for this user will be used.'),
      ),
      'job_id' => array(
        'description' => dt('The job ID to run.'),
        'required' => TRUE,
      ),
      'parallel' => dt('Normally jobs are executed one at a time. But if you are certain no conflicts will occur with other currently running jobs you may set this argument to a value of 1 to make the job run in parallel with other running jobs.'),
      'max_jobs' => dt('Indicate the maximum number of concurrent jobs. Default is -1 (unlimited). Ignore if not running parallel jobs'),
      'single' => dt('Execute only one queued job'),
    ),
  );
  $items['trp-get-cversion'] = array(
    'description' => dt('Returns the current installed version of Chado.'),
    'arguments' => array(),
    'examples' => array(
      'Standard Example' => 'drush trp-get-cversion',
    ),
  );
  $items['trp-get-table'] = array(
    'description' => dt('Returns a table description in Drupal Schema API format.'),
    'arguments' => array(),
    'examples' => array(
      'By Table Name' => 'drush trp-get-table --table=feature',
      'By Section' => 'drush trp-get-table --table=feature --section=fields'
    ),
    'options' => array(
      'table' => array(
        'description' => dt('The name of the table. The table can be a true Chado table or a custom Chado table.'),
        'required' => TRUE,
      ),
      'section' => dt('Only return the specified section of the schema array. Possible sections include: description, fields, primary key, unique keys, foreign keys, indexes, referring_tables.'),
    ),
  );
  $items['trp-clean-nodes'] = array(
    'description' => dt('Removes orphaned Drupal nodes.'),
    'arguments' => array(),
    'examples' => array(
      'Standard Example' => 'drush trp-clean-nodes table=feature'
    ),
    'options' => array(
      'table' => array(
        'description' => dt('The name of the table that corresonds to the node type to ' .
          'clean up. (e.g organism, feature, stock, library, analysis, pub, etc.)'),
        'required' => TRUE,
      ),
    ),
  );

  // DEPRECATED COMMANDS. Deprecated as of Tripal v2.0-rc
  $items['tripal-mview-update'] = array(
    'description' => dt('DEPRECATED. Please see: trp-refresh-mview.'),
    'arguments' => array(),
    'examples' => array(
      'By Materialized View ID' => 'drush tripal-update-mview --mview_id=5',
      'By Table Name' => 'drush tripal-update-mview --table_name=organism_feature_count'
    ),
    'options' => array(
      'mview_id' => dt('The ID of the materialized view to update'),
      'table_name' => dt('The name of the materialized view table to update.'),
    ),
    'aliases' => array('trpmv-up')
  );
  $items['tripal-jobs-current'] = array(
    'description' => dt('DEPRECATED. Please see: trp-get-currjob.'),
    'arguments' => array(),
    'examples' => array(
      'Standard example' => 'drush tripal-jobs-current',
    ),
    'aliases' => array('trpjob-cur'),
  );
  $items['tripal-jobs-launch'] = array(
    'description' => dt('DEPRECATED. Please see: trp-run-jobs. '),
    'examples' => array(
      'Normal Job' => 'drush tripal-jobs-launch admin',
      'Parallel Job' => 'drush tripal-jobs-launch admin --parallel=1'
    ),
    'arguments' => array(
      'username' => dt('The Drupal username under which the job should be run.  The permissions for this user will be used.'),
    ),
    'options' => array(
      'parallel' => dt('Normally jobs are executed one at a time. But if you are certain no conflicts will occur with other currently running jobs you may set this argument to a value of 1 to make the job run in parallel with other running jobs.'),
      'job_id' => dt('Provide a job_id to run a specific job. Only jobs that have not been run already can be used'),
    ),
    'aliases' => array('trpjob-run')
  );
  $items['tripal-jobs-rerun'] = array(
    'description' => dt('DEPRECATED. Please see: trp-rerun-job. '),
    'examples' => array(
      'Normal Job' => 'drush tripal-jobs-rerun admin 2',
      'Parallel Job' => 'drush tripal-jobs-rerun admin  2 --parallel=1'
    ),
    'arguments' => array(
      'username' => dt('The Drupal username under which the job should be run.  The permissions for this user will be used.'),
      'job_id' => dt('The job ID to run.'),
    ),
    'options' => array(
      'parallel' => dt('Normally jobs are executed one at a time. But if you are certain no conflicts will occur with other currently running jobs you may set this argument to a value of 1 to make the job run in parallel with other running jobs.'),
    ),
    'aliases' => array('trpjob-rerun')
  );
  $items['tripal-chado-version'] = array(
    'description' => dt('DEPRECATED. Please see: trp-get-cversion. '),
    'arguments' => array(),
    'examples' => array(
      'Standard Example' => 'drush tripal-chado-version',
    ),
    'aliases' => array('trpchado-ver')
  );
  $items['tripal-chadotable-desc'] = array(
    'description' => dt('DEPRECATED. Please see: trp-get-table. '),
    'arguments' => array(
      'table_name' => dt('The name of the chado table.'),
    ),
    'examples' => array(
      'By Table Name' => 'drush tripal-chadotable-desc --table_name=feature'
    ),
    'options' => array(
      'section' => dt('Only return the specified section of the schema table description. Possible sections include: description, fields, primary key, unique keys, foreign keys, indexes, referring_tables.'),
    ),
    'aliases' => array('trpschema-tbl')
  );
  $items['tripal-node-clean'] = array(
    'description' => dt('DEPRECATED. Please see: trp-clean-nodes.'),
    'arguments' => array(
      'module' => dt('The name of the chado-centric module to clean-up.'),
    ),
    'examples' => array(
      'By Table Name' => 'drush tripal-node-clean feature'
    ),
    'options' => array(),
    'aliases' => array('trpnode-cln')
  );

  return $items;
}