]> granicus.if.org Git - curl/commitdiff
zsh completion: Preserve single quotes in output
authordanielsh@apache.org <danielsh@apache.org>
Wed, 18 Nov 2015 21:52:32 +0000 (21:52 +0000)
committerDaniel Stenberg <daniel@haxx.se>
Thu, 19 Nov 2015 11:10:31 +0000 (12:10 +0100)
When an option's help string contains literal single quotes, those
single quotes would be stripped from the option's description in the
completion output (unless the zsh RC_QUOTES option were set while the
completion function was being sourced, which is not the default).  This
patch makes the completion output contain single quotes where the --help
output does.

Closes #532

scripts/zsh.pl

index 7520a15a6d0eb1755ec4b411d3f57718a202b6f9..6bcbb739b93e214c00c4e906d697fd380c6d9da2 100755 (executable)
@@ -45,7 +45,7 @@ sub parse_main_opts {
 
         my $option = '';
 
-        $desc =~ s/'/''/g if defined $desc;
+        $desc =~ s/'/'\\''/g if defined $desc;
         $desc =~ s/\[/\\\[/g if defined $desc;
         $desc =~ s/\]/\\\]/g if defined $desc;