@@ -100,16 +100,27 @@ def update(ctx, service, remove):
100
100
docker_compose_command (command , compose_file )
101
101
102
102
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
+ )
104
106
@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
+ )
105
114
@click .pass_context
106
115
@only_if_service_exists
107
- def status (ctx , service ):
116
+ def status (ctx , service , tail ):
108
117
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 :
114
125
output .print_header (ctx , title )
115
126
docker_compose_command (command , compose_file )
0 commit comments