function drush_command

8.0.x drush_command()
6.x drush_command()
7.x drush_command()
3.x drush_command()
4.x drush_command()
5.x drush_command()
master drush_command()

Entry point for commands into the drush_invoke API

If a command does not have a callback specified, this function will be called.

This function will trigger $hook_drush_init, then if no errors occur, it will call drush_invoke() with the command that was dispatch.

If no errors have occured, it will run $hook_drush_exit.

3 string references to 'drush_command'
commandCase::testGetCommands in tests/commandTest.php
drush_command_defaults in includes/
drush_get_commands in includes/
Get a list of all implemented commands. This invokes hook_drush_command().


includes/, line 824
The drush command engine.


function drush_command() {
  $args = func_get_args();
  $command = drush_get_command();

  foreach (drush_command_implements("drush_init") as $name) {
    $func = $name . '_drush_init';
    drush_log(dt("Initializing drush commandfile: !name", array('!name' => $name)), 'bootstrap');
    call_user_func_array($func, $args);

  if (!drush_get_error()) {
    _drush_invoke_args($command['command-hook'], $args, $command['commandfile']);

  if (!drush_get_error()) {
    foreach (drush_command_implements('drush_exit') as $name) {
      $func = $name . '_drush_exit';
      call_user_func_array($func, $args);