From ecdd4d820296162c273c3344f844cf78af0e4426 Mon Sep 17 00:00:00 2001 From: Ophestra Date: Mon, 31 Mar 2025 04:41:08 +0900 Subject: fortify: clean ps output This format never changed ever since it was added. It used to show everything there is in a process state but that is no longer true for a long time. This change cleans it up in favour of `fortify show` displaying extra information. Signed-off-by: Ophestra --- print.go | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) (limited to 'print.go') diff --git a/print.go b/print.go index 7c6663bd..891c576b 100644 --- a/print.go +++ b/print.go @@ -247,22 +247,18 @@ func printPs(output io.Writer, now time.Time, s state.Store, short, flagJSON boo t := newPrinter(output) defer t.MustFlush() - t.Println("\tInstance\tPID\tApp\tUptime\tEnablements\tCommand") + t.Println("\tInstance\tPID\tApplication\tUptime") for _, e := range exp { - var ( - es = "(No confinement information)" - cs = "(No command information)" - as = "(No configuration information)" - ) + as := "(No configuration information)" if e.Config != nil { - es = e.Config.Confinement.Enablements.String() - cs = fmt.Sprintf("%q", e.Config.Args) as = strconv.Itoa(e.Config.Confinement.AppID) + if e.Config.ID != "" { + as += " (" + e.Config.ID + ")" + } } - t.Printf("\t%s\t%d\t%s\t%s\t%s\t%s\n", - e.s[:8], e.PID, as, now.Sub(e.Time).Round(time.Second).String(), strings.TrimPrefix(es, ", "), cs) + t.Printf("\t%s\t%d\t%s\t%s\n", + e.s[:8], e.PID, as, now.Sub(e.Time).Round(time.Second).String()) } - t.Println() } type expandedStateEntry struct { -- cgit v1.3.1