Skip to content

Commit 494d8d8

Browse files
committed
feat(cli): new vulnerability command
Signed-off-by: Salim Afiune Maya <[email protected]>
1 parent d0b2c3b commit 494d8d8

File tree

3 files changed

+358
-7
lines changed

3 files changed

+358
-7
lines changed

cli/cmd/integration.go

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,9 @@
1919
package cmd
2020

2121
import (
22-
"fmt"
22+
"os"
2323

24+
"github.com/olekukonko/tablewriter"
2425
"github.com/pkg/errors"
2526
"github.com/spf13/cobra"
2627

@@ -30,8 +31,10 @@ import (
3031
var (
3132
// integrationCmd represents the integration command
3233
integrationCmd = &cobra.Command{
33-
Use: "integration",
34-
Short: "Manage external integrations",
34+
Use: "integration",
35+
Aliases: []string{"int"},
36+
Short: "Manage external integrations",
37+
Long: ``,
3538
}
3639

3740
// integrationListCmd represents the list sub-command inside the integration command
@@ -53,7 +56,11 @@ var (
5356
return errors.Wrap(err, "unable to get integrations")
5457
}
5558

56-
fmt.Println(integrations.String())
59+
table := tablewriter.NewWriter(os.Stdout)
60+
table.SetHeader([]string{"Integration GUID", "Name", "Type", "Status", "State"})
61+
table.SetBorder(false)
62+
table.AppendBulk(integrations.Table())
63+
table.Render()
5764
return nil
5865
},
5966
}

cli/cmd/root.go

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,14 @@ var (
4141
SilenceErrors: true,
4242
Long: `
4343
The Lacework Command Line Interface is a tool that helps you manage the
44-
Lacework cloud security platform. You can use it to manage compliance
45-
reports, external integrations, vulnerability scans, and other operations.`,
44+
Lacework cloud security platform. Use it to manage compliance reports,
45+
external integrations, vulnerability scans, and other operations.
46+
47+
Start by configuring the Lacework CLI with the command:
48+
49+
$ lacework configure
50+
51+
This will prompt you for your Lacework account and a set of API access keys.`,
4652
PersistentPreRunE: func(cmd *cobra.Command, _ []string) error {
4753
switch cmd.Use {
4854
case "configure", "version":
@@ -60,7 +66,7 @@ func Execute() {
6066
// first, verify if the user provided a command to execute,
6167
// if no command was provided, only print out the usage message
6268
if noCommandProvided() {
63-
errcheckWARN(rootCmd.Usage())
69+
errcheckWARN(rootCmd.Help())
6470
os.Exit(127)
6571
}
6672

0 commit comments

Comments
 (0)