From: Steven McDonald Date: Sat, 13 Oct 2012 07:06:26 +0000 (+1100) Subject: Make 'list' output similar to that of chkconfig(8) X-Git-Tag: v0.1~4 X-Git-Url: http://git.steven-mcdonald.id.au/?a=commitdiff_plain;h=77d596e0e1a1304db8a5f02c8c544c3ee13de680;p=aids.git Make 'list' output similar to that of chkconfig(8) --- diff --git a/bin/aids b/bin/aids index 5388ea9..4155605 100755 --- a/bin/aids +++ b/bin/aids @@ -23,9 +23,11 @@ def main(argv) end def display_status(svc) - print "#{svc.name[0..14]}:#{' ' * (16 - svc.name[0..14].length)}" + print "#{svc.name[0..14]}#{' ' * (16 - svc.name[0..14].length)}" status = svc.status + prettystatus = nil AIDS::RUNLEVEL_ALL.each do |r| + print "\t" if prettystatus case status[r] when :start prettystatus = 'on' @@ -36,7 +38,7 @@ def display_status(svc) else next end - print "#{r}: #{prettystatus + ' ' * (8 - prettystatus.length)}" + print "#{r}:#{prettystatus}" end puts end