Rename install_cli to add_options
This commit is contained in:
@@ -37,7 +37,7 @@ def run(args=None):
|
||||
plugin_manager = get_plugin_manager(pre_options.plugins)
|
||||
|
||||
parser = get_parser()
|
||||
plugin_manager.hook.install_cli(parser=parser)
|
||||
plugin_manager.hook.add_options(parser=parser)
|
||||
|
||||
options = parser.parse_args(args=args)
|
||||
|
||||
|
||||
+1
-1
@@ -274,7 +274,7 @@ def ocr( # pylint: disable=unused-argument
|
||||
|
||||
parser = get_parser()
|
||||
_plugin_manager = get_plugin_manager(plugins)
|
||||
_plugin_manager.hook.install_cli(parser=parser)
|
||||
_plugin_manager.hook.add_options(parser=parser)
|
||||
|
||||
options = create_options(
|
||||
**{k: v for k, v in locals().items() if not k.startswith('_')}
|
||||
|
||||
@@ -26,8 +26,12 @@ hookspec = pluggy.HookspecMarker('ocrmypdf')
|
||||
|
||||
|
||||
@hookspec
|
||||
def install_cli(parser: ArgumentParser) -> None:
|
||||
"""Allows the plugin to add its own command line arguments."""
|
||||
def add_options(parser: ArgumentParser) -> None:
|
||||
"""Allows the plugin to add its own command line arguments.
|
||||
|
||||
Even if you do not intend to use plugins in a command line context, you
|
||||
should use this function to create your options.
|
||||
"""
|
||||
|
||||
|
||||
@hookspec
|
||||
|
||||
Reference in New Issue
Block a user