drush-ops/drush — pull request #955 by mortenson (2014-11-04 18:32:52+00:00)
Title: Added %env-vars for adding environmental variables to Drush commands

Following a discussion in Issue https://github.com/drush-ops/drush/issues/950, I have added a path-aliases option to add arbitrary environmental variables to generated Drush commands. This is useful for Drush users who have setups that require an environmental variable to be set for every Drush execution.

In my case I needed to send a dynamic variable to the my %drush-script, but there are likely other use cases for this as well. In my example, the %drush-script looks like:
```
!#/bin/bash
sudo -u $DRUSH_USER drush $@
```
and my site record looks like:
```
...
'path-aliases' => array(
'%drush-script' => '/home/mortenson/drush.sh',
'%env-vars' => array(
'DRUSH_USER' => $user
),
),
...
```
In this example, a dynamic $user is used to run Drush commands. I'm willing to change my approach to this if anyone has any suggestions.