From 925a8ee0fd819375984c63ccdb8e624348890c0f Mon Sep 17 00:00:00 2001 From: Luka Vandervelden Date: Thu, 24 Oct 2019 12:55:30 +0200 Subject: [PATCH] `service status`: improved UI --- src/status.cr | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/status.cr b/src/status.cr index 210260e..2e98497 100644 --- a/src/status.cr +++ b/src/status.cr @@ -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