Added more information to the status command

This commit is contained in:
jpk 2023-02-15 17:07:04 +01:00
parent 58423ede92
commit 4837b70073
2 changed files with 19 additions and 8 deletions

View File

@ -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)

View File

@ -1,6 +1,6 @@
[tool.poetry]
name = "doxy"
version = "0.5.1"
version = "0.5.2"
description = ""
authors = ["jpk <jpk@goatpr0n.de>"]
readme = "README.md"