It's not possible to do something like this from another drush command:

drush_invoke('enable', 'ping');

This is because drush_pm_enable in pm.drush.inc isn't getting its commands from its function arguments but doing drush_get_command() -- this gets the original command the user typed in.

Comments

moshe weitzman’s picture

@adrian - this is a bug, i imagine?

adrian’s picture

drush_invoke("enable", array("ping"));

adrian’s picture

the drush_commands should probably be removed and replaced by func_get_args();

moshe weitzman’s picture

Assigned: Unassigned » adrian

do you mean drush_get_command() calls should be removed?

joachim’s picture

Yes -- if the idea of drush_invoke() is that any command may be simulated by code, then no command should assume it was the original typed-in command.

moshe weitzman’s picture

Status: Active » Fixed

Committed a fix to updatedb and enable/disable/uninstall. Thanks.

Status: Fixed » Closed (fixed)

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