mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-07 18:24:30 -04:00
IGN:...
This commit is contained in:
parent
6b474cbc44
commit
ecdb460426
@ -12,7 +12,7 @@ BASH completion for calibre commands that are too complex for simple
|
||||
completion.
|
||||
'''
|
||||
|
||||
import sys, os, shlex, glob
|
||||
import sys, os, shlex, glob, re
|
||||
from functools import partial
|
||||
|
||||
from calibre import prints
|
||||
@ -53,8 +53,9 @@ def get_opts_from_parser(parser, prefix):
|
||||
for x in do_opt(o): yield x
|
||||
|
||||
def send(ans):
|
||||
pat = re.compile('([^0-9a-zA-Z_.])')
|
||||
for x in sorted(set(ans)):
|
||||
x = x.replace(' ', '\\ ')
|
||||
x = pat.sub(lambda m : '\\'+m.group(1), x)
|
||||
if x.endswith('\\ '):
|
||||
x = x[:-2]+' '
|
||||
prints(x)
|
||||
|
Loading…
x
Reference in New Issue
Block a user