drush_COMMAND_init

  1. drupal
    1. 7 drush.api.php function
Drupal 7 drush_COMMAND_init()

Initialize a command prior to validation. If a command needs to bootstrap to a higher level, this is best done in the command init hook. It is permisible to bootstrap in any hook, but note that if bootstrapping adds more commandfiles (*.drush.inc) to the commandfile list, the newly-added commandfiles will not have any hooks called until the next phase. For example, a command that calls drush_bootstrap_max() in drush_hook_COMMAND() would only permit commandfiles from modules enabled in the site to participate in drush_hook_post_COMMAND() hooks.

Related topics

File

sites/all/modules/drush/docs/drush.api.php, line 99
Documentation of the Drush API.

Code

function drush_COMMAND_init() {
  drush_bootstrap_max();
}