You are here

function modules_weight_drush_command in Modules weight 7

Same name and namespace in other branches
  1. 8.2 modules_weight.drush.inc \modules_weight_drush_command()
  2. 8 modules_weight.drush.inc \modules_weight_drush_command()

Implements hook_drush_command().

File

./modules_weight.drush.inc, line 14
Drush commands related to the Modules weight module.

Code

function modules_weight_drush_command() {
  $items['mw-show-system-modules'] = array(
    'description' => dt('Configures if we can reorder the core modules.'),
    'arguments' => array(
      'status' => dt('The status option (on, off).'),
    ),
    'aliases' => array(
      'mw-ssm',
    ),
    'examples' => array(
      'mw-show-system-modules' => dt('Shows if we can reorder the core modules or not.'),
      'mw-show-system-modules on' => dt('Allows reorder the core modules.'),
      'mw-show-system-modules off' => dt("Don't allows reorder the core modules."),
    ),
  );
  $items['mw-reorder'] = array(
    'description' => dt('Configures the modules weight.'),
    'arguments' => array(
      'module' => dt('The module machine name.'),
      'weight' => dt('The module weight.'),
    ),
    'options' => array(
      'minus' => array(
        'description' => dt('If the option is present the weight will be consider as a negative value. Read for more information https://drupal.stackexchange.com/q/246298/28275 .'),
      ),
    ),
    'aliases' => array(
      'mw-r',
    ),
    'examples' => array(
      'mw-reorder node_revision_delete' => dt('Show the node_revision_delete module weight.'),
      'mw-reorder onlyone -5 --minus' => dt('Set the onlyone module weight to -5.'),
      'mw-reorder no_autocomplete 15' => dt("Set the no_autocomplete module weight to 15."),
    ),
  );
  $field_labels = array(
    'name' => dt('Name'),
    'machine_name' => dt('Machine Name'),
    'weight' => dt('Weight'),
    'package' => dt('Package'),
  );
  $items['mw-list'] = array(
    'description' => dt('Shows the modules weight list.'),
    'options' => array(
      'force' => array(
        'description' => dt('If the option is present the core modules will be shown even if the option to allow it is disabled.'),
      ),
    ),
    'outputformat' => array(
      'default' => 'table',
      'pipe-format' => 'list',
      'field-labels' => $field_labels,
      'output-data-type' => 'format-table',
    ),
    'aliases' => array(
      'mw-l',
    ),
    'examples' => array(
      'mw-list' => dt('Shows the modules weight list.'),
      'mw-list --force' => dt('Shows the modules weight list with the core modules even if the option to allow it is disabled.'),
    ),
  );
  return $items;
}