aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2015-04-04 11:49:04 +0200
committerMattias Andrée <maandree@operamail.com>2015-04-04 11:49:04 +0200
commitddee7a263bf66d6b114c785f935452492620a9a7 (patch)
tree590d1f052d78bd9043aee0730dc6cf9cee05b6ed
parentupdate dist (diff)
downloadauto-auto-complete-ddee7a263bf66d6b114c785f935452492620a9a7.tar.gz
auto-auto-complete-ddee7a263bf66d6b114c785f935452492620a9a7.tar.bz2
auto-auto-complete-ddee7a263bf66d6b114c785f935452492620a9a7.tar.xz
escape text in description for zsh
Signed-off-by: Mattias Andrée <maandree@operamail.com>
-rwxr-xr-xsrc/auto-auto-complete.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/auto-auto-complete.py b/src/auto-auto-complete.py
index 8637fe0..da8d56f 100755
--- a/src/auto-auto-complete.py
+++ b/src/auto-auto-complete.py
@@ -718,7 +718,9 @@ class GeneratorZSH:
continue
buf += ' \'(%s)\'{%s}' % (' '.join(options), ','.join(options))
if 'desc' in item:
- buf += '"["%s"]"' % verb(' '.join(item['desc']))
+ desc = ' '.join(item['desc'])
+ desc = desc.replace('\\', '\\\\').replace('[', '\\[').replace(']', '\\]')
+ buf += '"["%s"]"' % verb(desc)
if 'arg' in item:
buf += '":%s"' % verb(' '.join(item['arg']))
elif options[0] in suggesters: