After setting the drush dependencies in the command hook to specify the requirement of another drush command, I noticed that the command indeed didn't execute, but I saw strange error output:

Command xxxxx needs the following module(s) enabled to run: xxxxx.                                            [error]
The drush command 'xxxxx' could not be executed.                                                              [error]

After looking at the bootstrap process and drush_enforce_requirement_drush_dependencies(), I noticed that
$command['bootstrap_errors']['DRUSH_COMMAND_DEPENDENCY_ERROR'] was being set with the error message, but because
if ($bootstrap_result && empty($command['bootstrap_errors'])) {
shows that the bootstrap_errors aren't empty, $command_found is not being set to TRUE. Thus... invoking the disabled module error above.

Comments

markhalliwell’s picture

jonhattan’s picture

Title: Command drush dependencies error output not being generated. » Show the corresponding bootstrap error
Status: Active » Fixed

Drush was overwriting bootstrap errors at drush_command_belongs_to_disabled_module(). Fixed in http://drupalcode.org/project/drush.git/commit/05f164f and added two more tests.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.