You are here

function better_statistics_drush_command in Better Statistics 7

Implements hook_drush_command().

File

./better_statistics.drush.inc, line 12
Drush integration of Better Statistics.

Code

function better_statistics_drush_command() {
  $items = array();
  $items['stats-ls'] = array(
    'description' => 'List statistics fields.',
    'drupal dependencies' => array(
      'better_statistics',
    ),
    'options' => array(
      'all' => 'Show all fields. If no flags are provided, this is the default.',
      'enabled' => 'Show only active fields.',
      'disabled' => 'Show only fields not currently enabled.',
      'pipe' => 'Output each field name, one per line.',
    ),
    'examples' => array(
      'drush stats-ls' => 'Returns a list of all statistics fields.',
      'drush stats-ls --enabled' => 'Returns a list of enabled/active statistics fields.',
    ),
    'bootstrap' => DRUSH_BOOTSTRAP_DRUPAL_DATABASE,
  );
  $items['stats-en'] = array(
    'description' => 'Enable the specified statistics field(s).',
    'drupal dependencies' => array(
      'better_statistics',
    ),
    'arguments' => array(
      'fields' => 'One or several statistics fields to enable. Use ‘drush stats-ls‘ for a full list.',
    ),
    'examples' => array(
      'drush stats-en peak_memory' => 'Enable the peak_memory field.',
      'drush stats-en cache peak_memory' => 'Enable the cache and peak_memory fields.',
    ),
  );
  $items['stats-dis'] = array(
    'description' => 'Disable the specified statistics field(s). Note that this will permanently delete all data for the specified field(s).',
    'drupal dependencies' => array(
      'better_statistics',
    ),
    'arguments' => array(
      'fields' => 'One or several statistics fields to disable. Use ‘drush stats-ls‘ for a full list.',
    ),
    'examples' => array(
      'drush stats-dis peak_memory' => 'Disable the peak_memory field.',
      'drush stats-dis cache peak_memory' => 'Disable the cache and peak_memory fields.',
    ),
  );
  return $items;
}