# HG changeset patch # User Mads Kiilerich # Date 1597756409 -7200 # Node ID d435713db775aaf585c2d3e6ea20c27097af1f36 # Parent 659ecd26002cc926cad2ceeb91790363b2d350c8 cli: avoid register_command overload of "config_file" diff -r 659ecd26002c -r d435713db775 kallithea/bin/kallithea_cli_base.py --- a/kallithea/bin/kallithea_cli_base.py Tue Aug 18 13:52:58 2020 +0200 +++ b/kallithea/bin/kallithea_cli_base.py Tue Aug 18 15:13:29 2020 +0200 @@ -53,10 +53,10 @@ def cli(): """Various commands to manage a Kallithea instance.""" -def register_command(config_file=False, config_file_initialize_app=False, hidden=False): +def register_command(needs_config_file=False, config_file_initialize_app=False, hidden=False): """Register a kallithea-cli subcommand. - If one of the config_file flags are true, a config file must be specified + If one of the needs_config_file flags are true, a config file must be specified with -c and it is read and logging is configured. The configuration is available in the kallithea.CONFIG dict. @@ -64,7 +64,7 @@ (including tg.config), and database access will also be fully initialized. """ cli_command = cli.command(hidden=hidden) - if config_file or config_file_initialize_app: + if needs_config_file or config_file_initialize_app: def annotator(annotated): @click.option('--config_file', '-c', help="Path to .ini file with app configuration.", type=click.Path(dir_okay=False, exists=True, readable=True), required=True) diff -r 659ecd26002c -r d435713db775 kallithea/bin/kallithea_cli_db.py --- a/kallithea/bin/kallithea_cli_db.py Tue Aug 18 13:52:58 2020 +0200 +++ b/kallithea/bin/kallithea_cli_db.py Tue Aug 18 15:13:29 2020 +0200 @@ -19,7 +19,7 @@ from kallithea.model.meta import Session -@cli_base.register_command(config_file=True) +@cli_base.register_command(needs_config_file=True) @click.option('--reuse/--no-reuse', default=False, help='Reuse and clean existing database instead of dropping and creating (default: no reuse)') @click.option('--user', help='Username of administrator account.') diff -r 659ecd26002c -r d435713db775 kallithea/bin/kallithea_cli_extensions.py --- a/kallithea/bin/kallithea_cli_extensions.py Tue Aug 18 13:52:58 2020 +0200 +++ b/kallithea/bin/kallithea_cli_extensions.py Tue Aug 18 15:13:29 2020 +0200 @@ -29,7 +29,7 @@ from kallithea.lib.utils2 import ask_ok -@cli_base.register_command(config_file=True) +@cli_base.register_command(needs_config_file=True) def extensions_create(): """Write template file for extending Kallithea in Python. diff -r 659ecd26002c -r d435713db775 kallithea/bin/kallithea_cli_iis.py --- a/kallithea/bin/kallithea_cli_iis.py Tue Aug 18 13:52:58 2020 +0200 +++ b/kallithea/bin/kallithea_cli_iis.py Tue Aug 18 15:13:29 2020 +0200 @@ -57,7 +57,7 @@ HandleCommandLine(params) ''' -@cli_base.register_command(config_file=True) +@cli_base.register_command(needs_config_file=True) @click.option('--virtualdir', default='/', help='The virtual folder to install into on IIS.') def iis_install(virtualdir):