diff --git a/src/DumpCommand.php b/src/DumpCommand.php index d15ca46..9ef33e1 100644 --- a/src/DumpCommand.php +++ b/src/DumpCommand.php @@ -153,10 +153,17 @@ private function render($template, $vars) $helpers = array( 'zsh_describe' => function($value, $description = null) { $value = '"'.str_replace(':', '\\:', $value); + + // Temporarily replace " with something replaceable after escapeshellcmd + $description = str_replace('"', '__DOUBLE_QUOTE__', $description); + if (!empty($description)) { $value .= ':'.escapeshellcmd($description); } + // Restore and escape " + $value = str_replace('__DOUBLE_QUOTE__', '\"', $value); + return $value.'"'; } );