Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hi
If I do "drush" I get a list of command available but if y do "drush @alias" using one of the alias defined in the aliases.drushrc.php I get nothing instead of the fallback to help
Doing the command with --debug I get this:
Undefined offset: 0 sitealias.inc:25 [0.13 sec, 8.02 MB] [notice]
Undefined variable: alias_record sitealias.inc:238 [0.13 sec, 8.02 MB] [notice]
Comments
Comment #1
moshe weitzman CreditAttribution: moshe weitzman commenteddrush_parse_args() usually adds 'help' as an argument if it doesn't find any other args. This is how we show help even when the help command is not specified. But when one uses an alias, this drush_parse_args() thinks the alias is an argument and thus does not add 'help'.
Assigning to Greg since I'm not sure what the best resolution is. Still minor.
Comment #2
greg.1.anderson CreditAttribution: greg.1.anderson commentedI thought that there was some discussion on this issue; maybe there is a duplicate somewhere? In any event, I was not convinced that 'help' should necessarily be the default when drush with just an alias is used (e.g.
drush @site
). This just came up on StackExchange (http://drupal.stackexchange.com/questions/38985/drush-and-multisite-config); given that the context of the site alias changes which commands are available, perhaps it is reasonable to expect thatdrush @site
should produce help output.Maybe
drush @site
should show only the drush commands defined by modules in the bootstrapped site? Filtering out the global commands, to see only the site-local commands seems like a useful thing to do. Maybe there should be an option to help, --site-only, which could default to 'false' in the general case (drush help
,drush @site help
), but default to on fordrush @site
(which would then map todrush @site help --site-only
). A one-line explanation of what just happened would also be reasonable.If the behavior sounds right, I will submit a patch.
Comment #3
moshe weitzman CreditAttribution: moshe weitzman commentedThat sounds too complicated. I would think that
Drush @alias
would be equivalent todrush @alias help
and thus we show all commands that are available on the remote side, just as if we were ssh into that box and runningdrush help
there.Comment #4
greg.1.anderson CreditAttribution: greg.1.anderson commentedI'll implement those features in separate issues, then, so they may be considered independently.
Comment #5
greg.1.anderson CreditAttribution: greg.1.anderson commentedThis issue was marked
closed (won't fix)
because Drush has moved to Github.If desired, you may copy this bug to our Github project and then post a link here to the new issue. Please also change the status of this issue to
closed (duplicate)
.Please ask support questions on Drupal Answers.