Skip to content

Commit

Permalink
feat(cli): capitalize formats, update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jasminesun-lw committed Aug 22, 2023
1 parent ac810ea commit bb2e3c4
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions api/alerts_comment.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
6 changes: 3 additions & 3 deletions cli/cmd/alert_comment.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
`,
Expand All @@ -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)",
)
}

Expand Down
4 changes: 2 additions & 2 deletions cli/cmd/alert_comment_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
},
}

Expand Down
6 changes: 3 additions & 3 deletions cli/docs/lacework_alert_comment.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand All @@ -28,7 +28,7 @@ lacework alert comment <alert_id> [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
```

Expand Down
2 changes: 1 addition & 1 deletion integration/alert_comment_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
6 changes: 3 additions & 3 deletions integration/test_resources/help/alert_comment
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand All @@ -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:
Expand Down

0 comments on commit bb2e3c4

Please sign in to comment.