aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorAlessandro Ghedini <alessandro@ghedini.me>2019-02-05 21:06:26 +0000
committerAlessandro Ghedini <alessandro@ghedini.me>2019-02-07 21:51:53 +0000
commitb3cc8017b7364f588365be2b2629c49c142efdb7 (patch)
tree9d3a47d5db923db7b236ac443d854578e50c458b /scripts
parentdbd32f3241b297b96ee11a51da1a661f528ca026 (diff)
zsh.pl: escape ':' character
':' is interpreted as separator by zsh, so if used as part of the argument or option's description it needs to be escaped. The problem can be reproduced as follows: % curl --reso<TAB> % curl -E <TAB> Bug: https://bugs.debian.org/921452
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/zsh.pl3
1 files changed, 3 insertions, 0 deletions
diff --git a/scripts/zsh.pl b/scripts/zsh.pl
index 941b3222c..0f9cbec7d 100755
--- a/scripts/zsh.pl
+++ b/scripts/zsh.pl
@@ -45,9 +45,12 @@ sub parse_main_opts {
my $option = '';
+ $arg =~ s/\:/\\\:/g if defined $arg;
+
$desc =~ s/'/'\\''/g if defined $desc;
$desc =~ s/\[/\\\[/g if defined $desc;
$desc =~ s/\]/\\\]/g if defined $desc;
+ $desc =~ s/\:/\\\:/g if defined $desc;
$option .= '{' . trim($short) . ',' if defined $short;
$option .= trim($long) if defined $long;