changeset 8616:d435713db775

cli: avoid register_command overload of "config_file"
author Mads Kiilerich <mads@kiilerich.com>
date Tue, 18 Aug 2020 15:13:29 +0200
parents 659ecd26002c
children 1ecd6c0e2787
files kallithea/bin/kallithea_cli_base.py kallithea/bin/kallithea_cli_db.py kallithea/bin/kallithea_cli_extensions.py kallithea/bin/kallithea_cli_iis.py
diffstat 4 files changed, 6 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- 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)
--- 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.')
--- 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.
 
--- 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):