function _drush_escape_option

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

Return a properly formatted and escaped command line option

Parameters

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/backend.inc
Map the options to a string containing all the possible arguments and options.

File

includes/backend.inc, line 1235
Drush backend API

Code

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;
}