From b28496fd6b209ac1562468db43d88dc74c1860f4 Mon Sep 17 00:00:00 2001 From: Stian Fredrik Aune Date: Sat, 25 Sep 2021 17:27:56 +0200 Subject: [PATCH] less focus on oneshot --- cmd/lucy/tables.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/cmd/lucy/tables.go b/cmd/lucy/tables.go index 8e639ab..327dae0 100644 --- a/cmd/lucy/tables.go +++ b/cmd/lucy/tables.go @@ -76,7 +76,7 @@ func WriteDeviceInfoTable(w io.Writer, devices []models.Device) { func WriteHandlerInfoTable(w io.Writer, handlers []models.EventHandler) { table := tablewriter.NewWriter(w) - table.SetHeader([]string{"ID", "EVENT NAME", "ONE SHOT", "PRIORITY", "CONDITIONS", "TARGET", "ACTION"}) + table.SetHeader([]string{"ID", "EVENT NAME", "PRIORITY", "CONDITIONS", "TARGET", "ACTION"}) table.SetReflowDuringAutoWrap(false) for _, h := range handlers { @@ -102,10 +102,14 @@ func WriteHandlerInfoTable(w io.Writer, handlers []models.EventHandler) { actionStr += fmt.Sprintf("fireEvent=%s ", (*h.Actions.FireEvent).Name) } + eventName := h.EventName + if h.OneShot { + eventName += " (one shot)" + } + table.Append([]string{ strconv.Itoa(h.ID), - h.EventName, - strconv.FormatBool(h.OneShot), + eventName, strconv.Itoa(h.Priority), condStr, fmt.Sprintf("%s:%s", h.TargetKind, h.TargetValue),