diff --git a/src/calibre/debug.py b/src/calibre/debug.py index 86b2ebf00b..622ab41eb1 100644 --- a/src/calibre/debug.py +++ b/src/calibre/debug.py @@ -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.') diff --git a/src/calibre/linux.py b/src/calibre/linux.py index 5f0a2ec7d7..401cab6418 100644 --- a/src/calibre/linux.py +++ b/src/calibre/linux.py @@ -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())