function drush_set_option

8.0.x drush_set_option($option, $value, $context = 'process')
6.x drush_set_option($option, $value, $context = 'process')
7.x drush_set_option($option, $value, $context = 'process')
3.x drush_set_option($option, $value, $context = 'process')
4.x drush_set_option($option, $value, $context = 'process')
5.x drush_set_option($option, $value, $context = 'process')
master drush_set_option($option, $value, $context = 'process')

Set an option in one of the option contexts.


option: The option to set.

value: The value to set it to.

context: Optional. Which context to set it in.

Return value

The value parameter. This allows for neater code such as $myvalue = drush_set_option('http_host', $_SERVER['HTTP_HOST']); Without having to constantly type out the value parameter.

12 calls to drush_set_option()
drush_core_watchdog_list in commands/core/
Command callback.
drush_set_default in includes/
A small helper function to set the value in the default context
drush_sitealias_evaluate_path in includes/
Evaluate a path from its shorthand form to a literal path usable by rsync.
drush_upgrade_site_upgrade in commands/core/
A drush command callback.
update_main in commands/core/drupal/

... See full list


includes/, line 490
The Drush context API implementation.


function drush_set_option($option, $value, $context = 'process') {
  $cache = &drush_get_context($context);
  $cache[$option] = $value;
  return $value;