1

drush allows you to pass default arguments in a drushrc.php-file like:

    $command_specific['command'] = array(
      'argument' => 'value',
      …
    );

This seems only to work for named options. Is there a way to also pass positional arguments via drushrc.php (like the installation-profile for drush site-install)?

I tried to use $command_specific['site-install'][0] = 'profile'; but that didn't work.

2 Answers 2

3

Alas, there is no command-specific argument feature in Drush. You can't even use a pre-command hook to fill in the arguments, as Drush will check for required arguments before calling any command hooks.

Another option would be to define a shell alias, and define your argument there:

$options['shell-aliases']['myis'] = 'site-install xyzzy';

Then you can use this as drush myis [other options], and your profile name will be inserted.

0

This shell alias works for me. This means that you can define a shell alias that sets default parameters (and options if you want) for an existing command:

$options['shell-aliases']['site-install'] = '--yes site-install xyzzy';

Developers would simply need to run drush site-install.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.