Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

Commit

Permalink
Comments and help
Browse files Browse the repository at this point in the history
  • Loading branch information
vkostyanetsky committed Aug 19, 2023
1 parent fd71422 commit 27383e0
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions fastimer/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def cli(context, path: str):
__show(path)


@cli.command(help="Start a new fast.")
@cli.command(help="Start a new fasting.")
@click.argument("length", type=click.INT, default=16)
@click.option("-p", "--path", type=__path_type(), help=__path_help())
def start(path: str | None, length: int) -> None:
Expand All @@ -66,7 +66,7 @@ def start(path: str | None, length: int) -> None:
command_start.main(path, length)


@cli.command(help="Show fasts by date.")
@cli.command(help="Show details of fasting.")
@click.argument("what", default="last", type=click.Choice(["last", "prev", "on"]))
@click.argument("date", default="")
@click.option("-p", "--path", type=__path_type(), help=__path_help())
Expand All @@ -78,12 +78,7 @@ def show(path: str | None, what: str, date: str) -> None:
__show(path, what, date)


def __show(path, what="last", date=""):
path = __get_path(path)
command_show.main(path, what, date)


@cli.command(help="Stop ongoing fast.")
@cli.command(help="Stop ongoing fasting.")
@click.option("-p", "--path", type=__path_type(), help=__path_help())
def stop(path: str | None) -> None:
"""
Expand All @@ -94,7 +89,7 @@ def stop(path: str | None) -> None:
command_stop.main(path)


@cli.command(help="Show fasting statistics.")
@cli.command(help="Show accumulated statistics.")
@click.option("-p", "--path", type=__path_type(), help=__path_help())
def info(path: str | None) -> None:
"""
Expand All @@ -116,5 +111,14 @@ def cancel(path: str | None) -> None:
command_cancel.main(path)


def __show(path, what="last", date=""):
"""
Executes SHOW command (outputs detailed information about a fast).
"""

path = __get_path(path)
command_show.main(path, what, date)


if __name__ == "__main__":
cli()

0 comments on commit 27383e0

Please sign in to comment.