Skip to content

Commit 4837b70

Browse files
committed
Added more information to the status command
1 parent 58423ed commit 4837b70

File tree

2 files changed

+19
-8
lines changed

2 files changed

+19
-8
lines changed

doxy/cli.py

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -100,16 +100,27 @@ def update(ctx, service, remove):
100100
docker_compose_command(command, compose_file)
101101

102102

103-
@main.command(help="show service status (ps, top)", aliases=["stat", "info"])
103+
@main.command(
104+
help="show service status (images, ps, top, logs)", aliases=["stat", "info"]
105+
)
104106
@click.argument("service", nargs=1, shell_complete=complete_service_name)
107+
@click.option(
108+
"--tail",
109+
type=str,
110+
default=10,
111+
show_default=True,
112+
help="Number of lines to show from the end of the logs",
113+
)
105114
@click.pass_context
106115
@only_if_service_exists
107-
def status(ctx, service):
116+
def status(ctx, service, tail):
108117
compose_file = get_compose_file(Path(CONFIG.root_directory) / service)
109-
command_chain = {
110-
"Containers": ["ps"],
111-
"Running processes": ["top"],
112-
}
113-
for title, command in command_chain.items():
118+
command_chain = [
119+
("Images", ["images"]),
120+
("Containers", ["ps"]),
121+
("Running processes", ["top"]),
122+
("Log Messages", ["logs", "--tail", tail]),
123+
]
124+
for title, command in command_chain:
114125
output.print_header(ctx, title)
115126
docker_compose_command(command, compose_file)

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "doxy"
3-
version = "0.5.1"
3+
version = "0.5.2"
44
description = ""
55
authors = ["jpk <[email protected]>"]
66
readme = "README.md"

0 commit comments

Comments
 (0)