mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-04-22 14:03:05 +02:00
Fix use of common GUI launcher script broke generation of command line documentation for GUI commands
This commit is contained in:
parent
f24c20c3e7
commit
a579da463f
2 changed files with 12 additions and 1 deletions
|
|
@ -204,7 +204,10 @@ def cli_docs(app):
|
|||
continue
|
||||
module = __import__(module, fromlist=[module.split('.')[-1]])
|
||||
if hasattr(module, 'option_parser'):
|
||||
documented_cmds.append((cmd, getattr(module, 'option_parser')()))
|
||||
try:
|
||||
documented_cmds.append((cmd, getattr(module, 'option_parser')()))
|
||||
except TypeError:
|
||||
documented_cmds.append((cmd, getattr(module, 'option_parser')(cmd)))
|
||||
else:
|
||||
undocumented_cmds.append(cmd)
|
||||
|
||||
|
|
|
|||
|
|
@ -49,3 +49,11 @@ def ebook_edit():
|
|||
from calibre.gui2.tweak_book.main import main
|
||||
main()
|
||||
|
||||
def option_parser(basename):
|
||||
if basename == 'calibre':
|
||||
from calibre.gui2.main import option_parser
|
||||
elif basename == 'ebook-viewer':
|
||||
from calibre.gui2.viewer.main import option_parser
|
||||
elif basename == 'ebook-edit':
|
||||
from calibre.gui2.tweak_book.main import option_parser
|
||||
return option_parser()
|
||||
|
|
|
|||
Loading…
Reference in a new issue