📝 — Improve help messages

This commit is contained in:
Luc Didry 2024-04-11 09:26:01 +02:00
parent 8b3a8dd153
commit cf4441be29
No known key found for this signature in database
GPG key ID: EA868E12D0257E3C

View file

@ -90,7 +90,8 @@ def agent(server_url, auth, max_tasks, wait_time, log_level):
@click.option(
"--config",
default="config.yaml",
help="Path the the configuration file",
help="Path of the configuration file. "
"If ARGOS_YAML_FILE environment variable is set, its value will be used instead.",
envvar="ARGOS_YAML_FILE",
)
@click.option("--reload", is_flag=True, help="Enable hot reloading")
@ -132,7 +133,8 @@ def validate_max_results(ctx, param, value):
@click.option(
"--config",
default="config.yaml",
help="Path the the configuration file",
help="Path of the configuration file. "
"If ARGOS_YAML_FILE environment variable is set, its value will be used instead.",
envvar="ARGOS_YAML_FILE",
)
@coroutine
@ -156,16 +158,17 @@ async def cleandb(max_results, max_lock_seconds, config):
click.echo(f"{updated} locks released")
@server.command()
@server.command(short_help="Load or reload tasks configuration")
@click.option(
"--config",
default="config.yaml",
help="Path the the configuration file",
help="Path of the configuration file. "
"If ARGOS_YAML_FILE environment variable is set, its value will be used instead.",
envvar="ARGOS_YAML_FILE",
)
@coroutine
async def reload_config(config):
"""Read tasks configuration and add/delete tasks in database if needed"""
"""Read tasks configuration and add/delete tasks in database if needed"""
# The imports are made here otherwise the agent will need server configuration files.
from argos.server import queries
from argos.server.main import get_application, read_config
@ -188,7 +191,8 @@ async def reload_config(config):
@click.option(
"--config",
default="config.yaml",
help="Path the the configuration file",
help="Path of the configuration file. "
"If ARGOS_YAML_FILE environment variable is set, its value will be used instead.",
envvar="ARGOS_YAML_FILE",
)
@coroutine
@ -206,7 +210,7 @@ async def migrate(config):
command.upgrade(alembic_cfg, "head")
@server.command()
@server.command(short_help="Generate a token for agents")
@coroutine
async def generate_token():
"""Generate a token, which can be used as an agents authentication token.