You are here

function coder_drush_command in Coder 7.2

Same name and namespace in other branches
  1. 5.2 coder.drush.inc \coder_drush_command()
  2. 6.2 coder.drush.inc \coder_drush_command()
  3. 6 coder.drush.inc \coder_drush_command()
  4. 7 coder.drush.inc \coder_drush_command()

Implements hook_drush_command().

File

./coder.drush.inc, line 11
Drush integration for Coder module.

Code

function coder_drush_command() {
  $items['coder-format'] = array(
    'description' => dt('Re-format and rewrite code according Drupal coding standards.'),
    'arguments' => array(
      'path' => dt('The path of a file to reformat. Or the name of a directory to (recursively) reformat all contained files within.'),
    ),
    'options' => array(
      'undo' => dt('Restores already processed files from backups generated by Coder format. Automatically searches for the latest backup file ([filename].coder.orig) and each file is replaced with its original version.'),
    ),
    'examples' => array(
      'drush coder-format sites/all/modules/coder/coder.module' => 'Re-format coder.module according to Drupal coding standards.',
      'drush coder-format --undo sites/all/modules/coder/coder.module' => 'Restore coder.module from coder.module.coder.orig backup file (if existent).',
      'drush coder-format sites/all/modules/coder' => 'Recursively re-format Coder module files according to Drupal coding standards.',
      'drush coder-format --undo sites/all/modules/coder' => 'Recursively restore Coder module files from *.coder.orig backup files (if existent).',
    ),
  );
  return $items;
}