mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04: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
@ -204,7 +204,10 @@ def cli_docs(app):
|
||||
continue
|
||||
module = __import__(module, fromlist=[module.split('.')[-1]])
|
||||
if hasattr(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…
x
Reference in New Issue
Block a user