function views_drush_command

Implements hook_drush_command().

File

drush/views.drush.inc, line 37

Code

function views_drush_command() {
    $items = array();
    $items['views-revert'] = array(
        'callback' => 'views_revert_views',
        'drupal dependencies' => array(
            'views',
        ),
        'description' => 'Revert overridden views to their default state. Make sure to backup first.',
        'arguments' => array(
            'views' => 'A space delimited list of view names.',
        ),
        'bootstrap' => DRUSH_BOOTSTRAP_DRUPAL_FULL,
        'aliases' => array(
            'vr',
        ),
        'options' => array(
            'all' => 'If provided, all views will be reverted.',
        ),
        'examples' => array(
            'drush vr archive' => 'Reverts the "archive" view.',
            'drush rln archive frontpage' => 'Reverts the "archive" and "frontpage" view.',
            'drush vr' => 'Will present you with a list of overridden views to choose from, and an option to revert all overridden views.',
            'drush vr --all' => 'Will revert all overridden views.',
        ),
    );
    $items['views-dev'] = array(
        'callback' => 'views_development_settings',
        'drupal dependencies' => array(
            'views',
        ),
        'description' => 'Set the Views settings to more developer-oriented values.',
        'bootstrap' => DRUSH_BOOTSTRAP_DRUPAL_FULL,
        'aliases' => array(
            'vd',
        ),
    );
    $items['views-list'] = array(
        'drupal dependencies' => array(
            'views',
        ),
        'description' => 'Get a list of all views in the system.',
        'bootstrap' => DRUSH_BOOTSTRAP_DRUPAL_FULL,
        'aliases' => array(
            'vl',
        ),
        'options' => array(
            'name' => 'String contained in view\'s name by which filter the results.',
            'tags' => 'A comma-separated list of views tags by which to filter the results.',
            'status' => 'Status of the views by which to filter the results. Choices: enabled, disabled.',
            'type' => 'Type of the views by which to filter the results. Choices: normal, default or overridden.',
        ),
        'examples' => array(
            'drush vl' => 'Show a list of all available views.',
            'drush vl --name=blog' => 'Show a list of views which names contain "blog".',
            'drush vl --tags=tag1,tag2' => 'Show a list of views tagged with "tag1" or "tag2".',
            'drush vl --status=enabled' => 'Show a list of enabled views.',
            'drush vl --type=overridden' => 'Show a list of overridden views.',
        ),
    );
    $items['views-analyze'] = array(
        'drupal dependencies' => array(
            'views',
            'views_ui',
        ),
        'description' => 'Get a list of all Views analyze warnings',
        'bootstrap' => DRUSH_BOOTSTRAP_DRUPAL_FULL,
        'aliases' => array(
            'va',
        ),
    );
    $items['views-enable'] = array(
        'drupal dependencies' => array(
            'views',
        ),
        'description' => 'Enable the specified views.',
        'arguments' => array(
            'views' => 'A space delimited list of view names.',
        ),
        'aliases' => array(
            'ven',
        ),
        'examples' => array(
            'drush ven frontpage taxonomy_term' => 'Enable the frontpage and taxonomy_term views.',
        ),
    );
    $items['views-disable'] = array(
        'drupal dependencies' => array(
            'views',
        ),
        'description' => 'Disable the specified views.',
        'arguments' => array(
            'views' => 'A space delimited list of view names.',
        ),
        'aliases' => array(
            'vdis',
        ),
        'examples' => array(
            'drush vdis frontpage taxonomy_term' => 'Disable the frontpage and taxonomy_term views.',
        ),
    );
    return $items;
}