`service status`: improved UI

master
Luka Vandervelden 2019-10-24 12:55:30 +02:00
parent efc31bac79
commit 925a8ee0fd
1 changed files with 3 additions and 1 deletions

View File

@ -10,8 +10,10 @@ Service.load RC_DIRECTORY
LibC.setuid 0
LibC.setgid 0
list_status = false
services = ARGV
if services.size == 0
list_status = true
services = Service.all
else
services = services.map do |id|
@ -19,7 +21,7 @@ else
end
end
if services.size == 1
if services.size == 1 && ! list_status
services[0]?.try do |service|
puts service.status PID_DIRECTORY
exit 0