function modules_weight_drush_command in Modules weight 8
Same name and namespace in other branches
- 8.2 modules_weight.drush.inc \modules_weight_drush_command()
- 7 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'] = [
'description' => dt('Configures if we can reorder the core modules.'),
'arguments' => [
'status' => dt('The status option (on, off).'),
],
'examples' => [
'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."),
],
'aliases' => [
'mw-ssm',
],
];
$items['mw-reorder'] = [
'description' => dt('Configures the modules weight.'),
'arguments' => [
'module' => dt('The module machine name.'),
'weight' => dt('The module weight.'),
],
'options' => [
'minus' => [
'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 .'),
],
],
'examples' => [
'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."),
],
'aliases' => [
'mw-r',
],
];
$field_labels = [
'name' => dt('Name'),
'machine_name' => dt('Machine Name'),
'weight' => dt('Weight'),
'package' => dt('Package'),
];
$items['mw-list'] = [
'description' => dt('Shows the modules weight list.'),
'options' => [
'force' => [
'description' => dt('If the option is present the core modules will be shown even if the option to allow it is disabled.'),
],
],
'outputformat' => [
'default' => 'table',
'pipe-format' => 'list',
'field-labels' => $field_labels,
'output-data-type' => 'format-table',
],
'examples' => [
'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.'),
],
'aliases' => [
'mw-l',
],
];
return $items;
}