From ddee7a263bf66d6b114c785f935452492620a9a7 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sat, 4 Apr 2015 11:49:04 +0200 Subject: escape text in description for zsh MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/auto-auto-complete.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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: -- cgit v1.2.3-70-g09d2