From bb2e3c463061315b1fbeee8d2f947cc609f535ca Mon Sep 17 00:00:00 2001 From: Jasmine Sun Date: Tue, 22 Aug 2023 15:11:57 +0000 Subject: [PATCH] feat(cli): capitalize formats, update tests --- api/alerts_comment.go | 4 ++-- cli/cmd/alert_comment.go | 6 +++--- cli/cmd/alert_comment_test.go | 4 ++-- cli/docs/lacework_alert_comment.md | 6 +++--- integration/alert_comment_test.go | 2 +- integration/test_resources/help/alert_comment | 6 +++--- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/api/alerts_comment.go b/api/alerts_comment.go index caae66262..ece526ad7 100644 --- a/api/alerts_comment.go +++ b/api/alerts_comment.go @@ -40,8 +40,8 @@ type alertCommentFormats map[alertCommentFormat]string // AlertCommentFormats is the list of available Alert comment formats var AlertCommentFormats = alertCommentFormats{ - AlertCommentFormatPlaintext: "plaintext", - AlertCommentFormatMarkdown: "markdown", + AlertCommentFormatPlaintext: "Plaintext", + AlertCommentFormatMarkdown: "Markdown", } func (acf alertCommentFormats) GetOrderedFormatStrings() []string { diff --git a/cli/cmd/alert_comment.go b/cli/cmd/alert_comment.go index e895ad236..7cb30be03 100644 --- a/cli/cmd/alert_comment.go +++ b/cli/cmd/alert_comment.go @@ -38,8 +38,8 @@ var ( Comments may be provided inline or via editor. The following comment formats are allowed: - * plaintext - * markdown + * Plaintext + * Markdown Note: only markdown comments will be rendered using markdown. `, @@ -62,7 +62,7 @@ func init() { alertCommentCmd.Flags().StringVarP( &alertCmdState.Format, "format", "f", "", - "the format of the comment (default plaintext)", + "the format of the comment (default Plaintext)", ) } diff --git a/cli/cmd/alert_comment_test.go b/cli/cmd/alert_comment_test.go index 04d56f8a8..b6ac04900 100644 --- a/cli/cmd/alert_comment_test.go +++ b/cli/cmd/alert_comment_test.go @@ -22,13 +22,13 @@ func TestAlertComment(t *testing.T) { name: "Valid Comment with Markdown Format", args: []string{"12345"}, commentFlag: "This is a **markdown** comment.", - formatFlag: "markdown", + formatFlag: "Markdown", }, { name: "Valid Comment with Plain Text Format", args: []string{"12344"}, commentFlag: "This is a plain text comment.", - formatFlag: "plaintext", + formatFlag: "Plaintext", }, } diff --git a/cli/docs/lacework_alert_comment.md b/cli/docs/lacework_alert_comment.md index 17fa28773..08eee4482 100644 --- a/cli/docs/lacework_alert_comment.md +++ b/cli/docs/lacework_alert_comment.md @@ -15,8 +15,8 @@ Post a user comment on an alert's timeline . Comments may be provided inline or via editor. The following comment formats are allowed: - \* plaintext - \* markdown + * Plaintext + * Markdown Note: only markdown comments will be rendered using markdown. @@ -28,7 +28,7 @@ lacework alert comment [flags] ``` -c, --comment string a comment to add to the alert - -f, --format string the format of the comment (default plaintext) + -f, --format string the format of the comment (default Plaintext) -h, --help help for comment ``` diff --git a/integration/alert_comment_test.go b/integration/alert_comment_test.go index 4bcb0858d..704a64d21 100644 --- a/integration/alert_comment_test.go +++ b/integration/alert_comment_test.go @@ -28,7 +28,7 @@ import ( func makeComment(id string) (bytes.Buffer, bytes.Buffer, int) { return LaceworkCLIWithTOMLConfig( - "alert", "comment", id, "-c", "everything is awesome...cause go-sdk is here", "-f", "plaintext") + "alert", "comment", id, "-c", "everything is awesome...cause go-sdk is here", "-f", "Plaintext") } func TestAlertCommentMissingArg(t *testing.T) { diff --git a/integration/test_resources/help/alert_comment b/integration/test_resources/help/alert_comment index 247552a55..c951dcd39 100644 --- a/integration/test_resources/help/alert_comment +++ b/integration/test_resources/help/alert_comment @@ -3,8 +3,8 @@ Post a user comment on an alert's timeline . Comments may be provided inline or via editor. The following comment formats are allowed: - \* plaintext - \* markdown + * Plaintext + * Markdown Note: only markdown comments will be rendered using markdown. @@ -13,7 +13,7 @@ Usage: Flags: -c, --comment string a comment to add to the alert - -f, --format string the format of the comment (default plaintext) + -f, --format string the format of the comment (default Plaintext) -h, --help help for comment Global Flags: