function ctools_drush_command
Implements hook_drush_command().
File
-
drush/
ctools.drush.inc, line 11
Code
function ctools_drush_command() {
$items = array();
$module_text = 'Filter the list of exportables by module. This will come from the \'export_module\' key on the exportable.';
$all_text = 'Perform this operation all CTools exportables available on the system (all tables).';
$items['ctools-export'] = array(
'aliases' => array(
'ctex',
),
'callback' => 'ctools_drush_export',
'description' => 'Export multiple CTools exportable objects directly to code.',
'arguments' => array(
'module' => 'Name of your module.',
),
'options' => array(
'subdir' => 'The name of the sub directory to create the module in. Defaults to ctools_export which will be placed into sites/all/modules.',
'remove' => 'Remove existing files before writing, except the .module file.',
'filter' => 'Filter the list of exportables by status. Available options are enabled, disabled, overridden, database, code and all. Defaults to enabled.',
'tables' => 'Comma separated list of exportable table names to filter by.',
),
'examples' => array(
'drush ctex export_module' => 'Export CTools exportables to a module called "export_module".',
'drush ctex export_module --subdir=exports' => 'Same as above, but into the sites/all/modules/exports directory.',
'drush ctex export_module --subdir=exports --remove' => 'Same as above, but automatically removing all files, except for the .module file.',
'drush ctex --filter="views_view"' => 'Filter export selection to the views_view table only.',
),
);
$items['ctools-export-info'] = array(
'aliases' => array(
'ctei',
),
'callback' => 'ctools_drush_export_info',
'description' => 'Show available CTools exportable objects.',
'arguments' => array(),
'options' => array(
'format' => 'Display exportables info in a different format such as print_r, json, export. The default is to show in a tabular format.',
'tables-only' => 'Only show list of exportable types/table names and not available objects.',
'filter' => 'Filter the list of exportables by status. Available options are enabled, disabled, overridden, database, and code.',
'module' => $module_text,
),
'examples' => array(
'drush ctools-export-info' => 'View export info on all exportables.',
'drush ctools-export-info views_view variable' => 'View export info for views_view and variable exportable types only.',
'drush ctei --filter=enabled' => 'Show all enabled exportables.',
'drush ctei views_view --filter=disabled' => 'Show all enabled exportables.',
'drush ctei views_view --module=node' => 'Show all exportables provided by/on behalf of the node module.',
),
);
$items['ctools-export-view'] = array(
'aliases' => array(
'ctev',
),
'callback' => 'ctools_drush_export_op_command',
'description' => 'View CTools exportable object code output.',
'arguments' => array(
'table name' => 'Base table of the exportable you want to view.',
'machine names' => 'Space separated list of exportables you want to view.',
),
'options' => array(
'indent' => 'The string to use for indentation when displaying the exportable export code. Defaults to \'\'.',
'no-colour' => 'Remove any colour formatting from export string output. Ideal if you are sending the output of this command to a file.',
'module' => $module_text,
'all' => $all_text,
),
'examples' => array(
'drush ctools-export-view views_view' => 'View all views exportable objects.',
'drush ctools-export-view views_view archive' => 'View default views archive view.',
),
);
$items['ctools-export-revert'] = array(
'aliases' => array(
'cter',
),
'callback' => 'ctools_drush_export_op_command',
'description' => 'Revert CTools exportables from changes overridden in the database.',
'arguments' => array(
'table name' => 'Base table of the exportable you want to revert.',
'machine names' => 'Space separated list of exportables you want to revert.',
),
'options' => array(
'module' => $module_text,
'all' => $all_text,
),
'examples' => array(
'drush ctools-export-revert views_view' => 'Revert all overridden views exportable objects.',
'drush ctools-export-revert views_view archive' => 'Revert overridden default views archive view.',
'drush ctools-export-revert --all' => 'Revert all exportables on the system.',
),
);
$items['ctools-export-enable'] = array(
'aliases' => array(
'ctee',
),
'callback' => 'ctools_drush_export_op_command',
'description' => 'Enable CTools exportables.',
'arguments' => array(
'table name' => 'Base table of the exportable you want to enable.',
'machine names' => 'Space separated list of exportables you want to enable.',
),
'options' => array(
'module' => $module_text,
'all' => $all_text,
),
'examples' => array(
'drush ctools-export-enable views_view' => 'Enable all overridden views exportable objects.',
'drush ctools-export-enable views_view archive' => 'Enable overridden default views archive view.',
),
);
$items['ctools-export-disable'] = array(
'aliases' => array(
'cted',
),
'callback' => 'ctools_drush_export_op_command',
'description' => 'Disable CTools exportables.',
'arguments' => array(
'table name' => 'Base table of the exportable you want to disable.',
'machine names' => 'Space separated list of exportables you want to disable.',
),
'options' => array(
'module' => $module_text,
'all' => $all_text,
),
'examples' => array(
'drush ctools-export-disable views_view' => 'Disable all overridden views exportable objects.',
'drush ctools-export-disable views_view archive' => 'Disable overridden default views archive view.',
),
);
return $items;
}