From a root drupal folder, drush --verbose dl admin_menu works and downloads the module to /sites/all/modules/. However drush -v dl admin_menu fails, returning the following error:

Could not find a Drupal settings.php file at ./sites/default/settings.php.                                                      [error]
The command 'drush.php admin_menu' could not be executed.

Comments

moshe weitzman’s picture

It wants you to give value for -v. So, drush -v 2 dl admin_menu works as expected. The code tries to warn you when you forget to set a value for an option but in the case of drush -v status it thinks that status is the value. Ugh.

@adrian - is there some way to special case -v when sent without a value. it would be nice if `drush -v status` gave same output as `drush --verbose status`.

adrian’s picture

I didn't write that code ... and i have little clue how it works.

it's drush_parse_args in command.inc



/**
 * Parse console arguments.
 */
function drush_parse_args() {
  $args = drush_get_context('argv');

  static $arg_opts = array('c', 'h', 'u', 'r', 'l', 'i', 'v');

  $arguments = $options = array();

I think we can either require an argument to the short option, or not.

removing the v from that array will mean you can't set v 2

moshe weitzman’s picture

Status: Active » Fixed

Just committed a fix. use -v for some messages, or -d for all of them. the long opts are --verbose and --debug

Status: Fixed » Closed (fixed)

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