Improve help in cli
This commit is contained in:
parent
eaaf492293
commit
83f74ce799
17
bot_z/cli.py
17
bot_z/cli.py
|
@ -157,7 +157,7 @@ def start_daemon_command(
|
|||
@click.pass_context
|
||||
def list_command(ctx: click.Context, status: bool) -> None:
|
||||
"""
|
||||
Shows the clients attached
|
||||
Lists the clients attached
|
||||
"""
|
||||
logger.debug('Invoked the "list" command.')
|
||||
with PLifo(ctx.obj["lifo"]) as lifo:
|
||||
|
@ -181,7 +181,7 @@ def list_command(ctx: click.Context, status: bool) -> None:
|
|||
@click.pass_context
|
||||
def start_command(ctx: click.Context, name: str) -> None:
|
||||
"""
|
||||
Writes on the fifo. Invokes the start of a client.
|
||||
Starts a client.
|
||||
"""
|
||||
logger.debug("Sending the start command down the pipe: %s", ctx.obj["fifo"])
|
||||
with open(ctx.obj["fifo"], "w") as fifo:
|
||||
|
@ -193,8 +193,7 @@ def start_command(ctx: click.Context, name: str) -> None:
|
|||
@click.pass_context
|
||||
def stop_daemon_command(ctx: click.Context) -> None:
|
||||
"""
|
||||
Writes on the fifo. Invokes the stop of all the clients and the
|
||||
subsequent shutdown of the daemon.
|
||||
Stops all the clients and shuts down the daemon.
|
||||
"""
|
||||
logger.debug("Sending the stop-daemon command down the pipe: %s", ctx.obj["fifo"])
|
||||
with open(ctx.obj["fifo"], "w") as fifo:
|
||||
|
@ -207,7 +206,7 @@ def stop_daemon_command(ctx: click.Context) -> None:
|
|||
@click.pass_context
|
||||
def stop_command(ctx: click.Context, name: T.Optional[str]) -> None:
|
||||
"""
|
||||
Writes on the fifo. Invokes the stop.
|
||||
Stops a client.
|
||||
"""
|
||||
logger.debug("Sending the stop command down the pipe: %s", ctx.obj["fifo"])
|
||||
name = _check_name(ctx.obj["lifo"], name)
|
||||
|
@ -256,7 +255,7 @@ def login_command(
|
|||
force: bool,
|
||||
) -> None:
|
||||
"""
|
||||
Writes on the fifo. Invokes the stop.
|
||||
Logs a client in using the provided credentials.
|
||||
"""
|
||||
no_userpass = username is None or password is None
|
||||
if credfile is not None and no_userpass:
|
||||
|
@ -301,7 +300,7 @@ def login_command(
|
|||
@click.pass_context
|
||||
def logout_command(ctx: click.Context, name: T.Optional[str], force: bool) -> None:
|
||||
"""
|
||||
Writes on the fifo. Invokes the stop.
|
||||
Logs a logged in client out.
|
||||
"""
|
||||
logger.debug("Sending the logout command down the pipe: %s", ctx.obj["fifo"])
|
||||
name = _check_name(ctx.obj["lifo"], name)
|
||||
|
@ -316,7 +315,7 @@ def logout_command(ctx: click.Context, name: T.Optional[str], force: bool) -> No
|
|||
@click.pass_context
|
||||
def reload_command(ctx: click.Context, name: T.Optional[str]) -> None:
|
||||
"""
|
||||
Writes on the fifo. Invokes the reload.
|
||||
Resets a client to a clean state (discards the session).
|
||||
"""
|
||||
logger.debug("Sending the reload command down the pipe: %s", ctx.obj["fifo"])
|
||||
name = _check_name(ctx.obj["lifo"], name)
|
||||
|
@ -330,7 +329,7 @@ def reload_command(ctx: click.Context, name: T.Optional[str]) -> None:
|
|||
@click.pass_context
|
||||
def status_command(ctx: click.Context, name: T.Optional[str]) -> None:
|
||||
"""
|
||||
Writes on the fifo. Queries the status.
|
||||
Displays basic info on the state of a client.
|
||||
"""
|
||||
try:
|
||||
name = _check_name(ctx.obj["lifo"], name)
|
||||
|
|
Loading…
Reference in New Issue
Block a user