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

moshe weitzman’s picture

Assigned: Unassigned » greg.1.anderson

drush_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.

greg.1.anderson’s picture

I 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 that drush @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 for drush @site (which would then map to drush @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.

moshe weitzman’s picture

That sounds too complicated. I would think that Drush @alias would be equivalent to drush @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 running drush help there.

greg.1.anderson’s picture

I'll implement those features in separate issues, then, so they may be considered independently.

greg.1.anderson’s picture

Version: » 8.x-6.x-dev
Status: Active » Closed (won't fix)
Issue tags: +Needs migration

This 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.