From 6a14825115676bd3161315d9d1de3ecb1a21d213 Mon Sep 17 00:00:00 2001 From: rabbitstack Date: Fri, 3 Jan 2025 17:07:59 +0100 Subject: [PATCH] fix(cli): Fix rule yaml indent and provide feedback Fix the wrong indentation in the rule labels and provide the feedback to user after creating the rule file. --- cmd/fibratus/app/rules/create.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cmd/fibratus/app/rules/create.go b/cmd/fibratus/app/rules/create.go index d6cdbb58f..0a8fb41f8 100644 --- a/cmd/fibratus/app/rules/create.go +++ b/cmd/fibratus/app/rules/create.go @@ -20,6 +20,7 @@ package rules import ( "fmt" + "github.com/enescakir/emoji" "github.com/google/uuid" "github.com/rabbitstack/fibratus/pkg/config" "github.com/rabbitstack/fibratus/pkg/util/version" @@ -37,7 +38,7 @@ description: | {{- if .Labels }} labels: {{- range $key, $value := .Labels }} - {{ $key }}: {{ $value }} + {{ $key }}: {{ $value }} {{- end -}} {{ end }} @@ -99,5 +100,7 @@ func createRule(name string) error { return err } + emo("%v created %s. Open the file and craft the rule condition, define an optional action, or fill out other attributes", emoji.Rocket, n) + return nil }