From 6561774f9e4e066f471c54d1f54a3b3d45e299c9 Mon Sep 17 00:00:00 2001 From: Paul Gier Date: Mon, 25 Mar 2019 09:23:37 -0500 Subject: [PATCH] cli: fix some command output formatting - remove brackets around silence ID when adding new silence - fix simple formatting of show config Signed-off-by: Paul Gier --- cli/format/format_simple.go | 2 +- cli/silence_add.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cli/format/format_simple.go b/cli/format/format_simple.go index 5006e182..eec0511c 100644 --- a/cli/format/format_simple.go +++ b/cli/format/format_simple.go @@ -72,7 +72,7 @@ func (formatter *SimpleFormatter) FormatAlerts(alerts []*models.GettableAlert) e } func (formatter *SimpleFormatter) FormatConfig(status *models.AlertmanagerStatus) error { - fmt.Fprintln(formatter.writer, *status) + fmt.Fprintln(formatter.writer, *status.Config.Original) return nil } diff --git a/cli/silence_add.go b/cli/silence_add.go index e45c3e56..a51faf0a 100644 --- a/cli/silence_add.go +++ b/cli/silence_add.go @@ -169,6 +169,6 @@ func (c *silenceAddCmd) add(ctx context.Context, _ *kingpin.ParseContext) error if err != nil { return err } - fmt.Println(*postOk.Payload) + _, err = fmt.Println(postOk.Payload.SilenceID) return err }