Skip to content

Commit f9d42f3

Browse files
fix up output to be more readable
1 parent b8e3eda commit f9d42f3

2 files changed

Lines changed: 10 additions & 2 deletions

File tree

pkg/commands/ngwaf/workspaces/workspaces_test.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,11 @@ ID: someID
319319
Name: CLIWorkspace
320320
Description: NGWAFCLIWorkspace
321321
Mode: log
322-
Attack Signal Thresholds: Immediate false, One Minute 0, Ten Minutes 0, One Hour 0
322+
Attack Signal Thresholds:
323+
Immediate: false
324+
One Minute: 0
325+
Ten Minutes: 0
326+
One Hour: 0
323327
Client IP Headers: these, are, headers
324328
Updated (UTC): 0001-01-01 00:00
325329
`)

pkg/text/workspace.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,11 @@ func PrintWorkspace(out io.Writer, workspaceToPrint *workspaces.Workspace) {
1515
fmt.Fprintf(out, "Name: %s\n", workspaceToPrint.Name)
1616
fmt.Fprintf(out, "Description: %s\n", workspaceToPrint.Description)
1717
fmt.Fprintf(out, "Mode: %s\n", workspaceToPrint.Mode)
18-
fmt.Fprintf(out, "Attack Signal Thresholds: Immediate %t, One Minute %d, Ten Minutes %d, One Hour %d\n", workspaceToPrint.AttackSignalThresholds.Immediate, workspaceToPrint.AttackSignalThresholds.OneMinute, workspaceToPrint.AttackSignalThresholds.TenMinutes, workspaceToPrint.AttackSignalThresholds.OneHour)
18+
fmt.Fprint(out, "Attack Signal Thresholds:\n")
19+
fmt.Fprintf(out, " Immediate: %t\n", workspaceToPrint.AttackSignalThresholds.Immediate)
20+
fmt.Fprintf(out, " One Minute: %d\n", workspaceToPrint.AttackSignalThresholds.OneMinute)
21+
fmt.Fprintf(out, " Ten Minutes: %d\n", workspaceToPrint.AttackSignalThresholds.TenMinutes)
22+
fmt.Fprintf(out, " One Hour: %d\n", workspaceToPrint.AttackSignalThresholds.OneHour)
1923
if len(workspaceToPrint.ClientIPHeaders) != 0 {
2024
fmt.Fprintf(out, "Client IP Headers: %s\n", strings.Join(workspaceToPrint.ClientIPHeaders, ", "))
2125
}

0 commit comments

Comments
 (0)