You are here

function views_data_export_drush_command in Views data export 7.4

Same name and namespace in other branches
  1. 6.3 views_data_export.drush.inc \views_data_export_drush_command()
  2. 6 views_data_export.drush.inc \views_data_export_drush_command()
  3. 6.2 views_data_export.drush.inc \views_data_export_drush_command()
  4. 7 views_data_export.drush.inc \views_data_export_drush_command()
  5. 7.3 views_data_export.drush.inc \views_data_export_drush_command()

Implementation of hook_drush_command().

File

./views_data_export.drush.inc, line 6

Code

function views_data_export_drush_command() {
  $items = array();
  $items['views-data-export'] = array(
    'aliases' => array(
      'vde',
    ),
    'description' => 'Fully executes a views_data_export display of a view and writes the output to file.',
    'arguments' => array(
      'view_name' => 'The name of the view',
      'display_id' => 'The id of the views_data_export display to execute on the view',
      'output_file' => 'The file to write the results to - will be overwritten if it already exists',
    ),
    'options' => array(
      '--arguments' => 'Comma separated list of arguments to be passed to the view.',
      '--format' => 'csv,doc,txt,xls or xml. These options are ignored if the display_id passed is a "views_data_export" display.',
      '--separator' => 'csv only: What character separates the fields (default:,)',
      '--trim-whitespace' => 'csv only: Trim whitespace from either side of fields (default:1)',
      '--header-row' => 'csv only: Make the first row a row of headers (default:1)',
      '--quote-values' => 'csv only: Surround each field in quotes (default:1)',
    ),
    'examples' => array(
      'drush views-data-export myviewname views_data_export_1 output.csv' => 'Export myviewname:views_data_export_1 and write the output to output.csv in the current directory',
    ),
    'drupal dependencies' => array(
      'views_data_export',
    ),
    'core' => array(
      '7',
    ),
  );
  return $items;
}