diff options
author | Mattias Andrée <maandree@operamail.com> | 2015-04-04 11:49:04 +0200 |
---|---|---|
committer | Mattias Andrée <maandree@operamail.com> | 2015-04-04 11:49:04 +0200 |
commit | ddee7a263bf66d6b114c785f935452492620a9a7 (patch) | |
tree | 590d1f052d78bd9043aee0730dc6cf9cee05b6ed | |
parent | update dist (diff) | |
download | auto-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>
Diffstat (limited to '')
-rwxr-xr-x | src/auto-auto-complete.py | 4 |
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: |