diff options
| author | Ophestra <cat@gensokyo.uk> | 2025-03-31 04:41:08 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2025-03-31 04:41:08 +0900 |
| commit | ecdd4d820296162c273c3344f844cf78af0e4426 (patch) | |
| tree | 41df1eab24f67816ad07be9ddd3a687ee264fe32 /print.go | |
| parent | bdee0c3921c05a9f1286e09ffb7f602f6b316694 (diff) | |
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 <cat@gensokyo.uk>
Diffstat (limited to 'print.go')
| -rw-r--r-- | print.go | 18 |
1 files changed, 7 insertions, 11 deletions
@@ -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 { |
