Completion for calibre-debug

This commit is contained in:
Kovid Goyal 2013-02-28 12:08:31 +05:30
parent f1e36db970
commit 52be164385
2 changed files with 11 additions and 3 deletions

View File

@ -27,7 +27,7 @@ on.
parser.add_option('-e', '--exec-file', help='Run the python code in file.')
parser.add_option('-f', '--subset-font', help='Subset the specified font')
parser.add_option('-d', '--debug-device-driver', default=False, action='store_true',
help='Debug the specified device driver.')
help='Debug device detection')
parser.add_option('-g', '--gui', default=False, action='store_true',
help='Run the GUI with debugging enabled. Debug output is '
'printed to stdout and stderr.')

View File

@ -495,7 +495,9 @@ class PostInstall:
from calibre.utils.smtp import option_parser as smtp_op
from calibre.library.server.main import option_parser as serv_op
from calibre.ebooks.oeb.polish.main import option_parser as polish_op, SUPPORTED
from calibre.debug import option_parser as debug_op
from calibre.ebooks import BOOK_EXTENSIONS
from calibre.customize.ui import available_input_formats
input_formats = sorted(all_input_formats())
zsh = ZshCompleter(self.opts)
bc = os.path.join(os.path.dirname(self.opts.staging_sharedir),
@ -540,6 +542,14 @@ class PostInstall:
o_and_w('fetch-ebook-metadata', fem_op, [])
o_and_w('calibre-smtp', smtp_op, [])
o_and_w('calibre-server', serv_op, [])
o_and_e('calibre-debug', debug_op, ['py', 'recipe'], file_map={
'--tweak-book':['epub', 'azw3', 'mobi'],
'--subset-font':['ttf', 'otf'],
'--exec-file':['py', 'recipe'],
'--add-simple-plugin':['py'],
'--inspect-mobi':['mobi', 'azw', 'azw3'],
'--viewer':list(available_input_formats()),
})
f.write(textwrap.dedent('''
_ebook_device_ls()
{
@ -910,7 +920,5 @@ def main():
PostInstall(opts)
return 0
if __name__ == '__main__':
sys.exit(main())
sys.exit(main())