diff --git a/doxy/cli.py b/doxy/cli.py index e6cf16a..6423688 100644 --- a/doxy/cli.py +++ b/doxy/cli.py @@ -100,16 +100,27 @@ def update(ctx, service, remove): docker_compose_command(command, compose_file) -@main.command(help="show service status (ps, top)", aliases=["stat", "info"]) +@main.command( + help="show service status (images, ps, top, logs)", aliases=["stat", "info"] +) @click.argument("service", nargs=1, shell_complete=complete_service_name) +@click.option( + "--tail", + type=str, + default=10, + show_default=True, + help="Number of lines to show from the end of the logs", +) @click.pass_context @only_if_service_exists -def status(ctx, service): +def status(ctx, service, tail): compose_file = get_compose_file(Path(CONFIG.root_directory) / service) - command_chain = { - "Containers": ["ps"], - "Running processes": ["top"], - } - for title, command in command_chain.items(): + command_chain = [ + ("Images", ["images"]), + ("Containers", ["ps"]), + ("Running processes", ["top"]), + ("Log Messages", ["logs", "--tail", tail]), + ] + for title, command in command_chain: output.print_header(ctx, title) docker_compose_command(command, compose_file) diff --git a/pyproject.toml b/pyproject.toml index 6eba5c8..0a3eedf 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "doxy" -version = "0.5.1" +version = "0.5.2" description = "" authors = ["jpk "] readme = "README.md"