function _drush_escape_option

8.0.x _drush_escape_option($key, $value = TRUE, $os = NULL)
6.x _drush_escape_option($key, $value = TRUE, $os = NULL)
7.x _drush_escape_option($key, $value = TRUE, $os = NULL)
3.x _drush_escape_option($key, $value = TRUE)
4.x _drush_escape_option($key, $value = TRUE)
5.x _drush_escape_option($key, $value = TRUE, $os = NULL)
master _drush_escape_option($key, $value = TRUE, $os = NULL)

Return a properly formatted and escaped command line option


key: The name of the option.

value: The value of the option.

Return value

If the value is set to TRUE, this function will return " --key" In other cases it will return " --key='value'"

1 call to _drush_escape_option()
_drush_backend_argument_string in includes/
Map the options to a string containing all the possible arguments and options.


includes/, line 1227
Drush backend API


function _drush_escape_option($key, $value = TRUE, $os = NULL) {
  if ($value !== TRUE) {
    $option_str = " --$key=" . drush_escapeshellarg($value, $os);
  else {
    $option_str = " --$key";
  return $option_str;