There seems to be an error in the priority between the commandline and drushrc, probably related to an error in the array_merge() call here:

$args['options'] = array_merge($args['options'], $options); # Sets all the default options for drush

$options is the value inherited from drushrc, $args['options'] is the commandline.

The php manual says: If the input arrays have the same string keys, then the later value for that key will overwrite the previous one. ... about array_merge().

So that should read:

$args['options'] = array_merge($options, $args['options']); # Sets all the default options for drush

Patch (trivial) attached.

CommentFileSizeAuthor
drush.patch463 bytesanarcat

Comments

vingborg’s picture

That't definitely better aligned to how commandline tools usually works. +1 for this change.

I'll work that into the upcoming drush 2 branch.

adrian’s picture

I wrote the original patch for this, and I can confirm that this is not what I intended (there is an $override variable in drushrc that is provided for precisely this reason).

I will commit the patch later today to head, drupal-5 and drupal-6--1 branches

adrian’s picture

Status: Needs review » Fixed

Committed to d5, d6 and head branches.

Thanks anarcat.

http://drupal.org/cvs?commit=155554 - DRUPAL-5
http://drupal.org/cvs?commit=155555 - DRUPAL-6-1
http://drupal.org/cvs?commit=155556 - HEAD

btw. we need this fix to be rolled out in an official release before we can make our next release of aegir.
I really don't expect people to run -dev branches of modules on production servers =P

moshe weitzman’s picture

I have rolled new releases for both D5 and D6

Status: Fixed » Closed (fixed)

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