From 246e50228e9f3a6e4ad30fe7cf188aabdb1e7bcd Mon Sep 17 00:00:00 2001 From: "Baruch Odem (Rothkoff)" Date: Wed, 28 Jun 2023 18:09:50 +0300 Subject: [PATCH] docs: user feedbacks about documentation (#121) - fix: describing message for wrong instance - fix: If not giving folder, what will be scanned - fix: Can I give a Github URL? Or clone the repo? - docs: go install command installing an old version Closes #111 --- README.md | 5 +++-- plugins/git.go | 6 +++--- plugins/paligo.go | 7 +++++-- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 41d536dd..ed6e8fff 100644 --- a/README.md +++ b/README.md @@ -21,8 +21,9 @@ During the software development lifecycle (SDLC), developers ofen communicate an ## Getting 2ms -``` -go install github.com/checkmarx/2ms@latest +```bash +curl -LO https://github.com/Checkmarx/2ms/releases/latest/download/2ms && chmod +x 2ms +./2ms ``` ### Docker diff --git a/plugins/git.go b/plugins/git.go index 01766e92..37d7a28c 100644 --- a/plugins/git.go +++ b/plugins/git.go @@ -23,9 +23,9 @@ func (p *GitPlugin) DefineCommand(channels Channels) (*cobra.Command, error) { p.Channels = channels command := &cobra.Command{ - Use: fmt.Sprintf("%s ", p.GetName()), - Short: "Scan Git repository", - Long: "Scan Git repository for sensitive information.", + Use: fmt.Sprintf("%s ", p.GetName()), + Short: "Scan local Git repository", + Long: "Scan local Git repository for sensitive information.", Args: cobra.MatchAll(cobra.ExactArgs(1), validGitRepoArgs), Run: func(cmd *cobra.Command, args []string) { log.Info().Msg("Git plugin started") diff --git a/plugins/paligo.go b/plugins/paligo.go index 57e45f60..8f8eb0d8 100644 --- a/plugins/paligo.go +++ b/plugins/paligo.go @@ -90,7 +90,7 @@ func (p *PaligoPlugin) DefineCommand(channels Channels) (*cobra.Command, error) command.MarkFlagsMutuallyExclusive(paligoUsernameFlag, paligoAuthFlag) command.MarkFlagsMutuallyExclusive(paligoTokenFlag, paligoAuthFlag) - command.Flags().IntVar(&paligoFolderArg, paligoFolderFlag, 0, "Paligo folder ID") + command.Flags().IntVar(&paligoFolderArg, paligoFolderFlag, 0, "Paligo folder ID. If not specified, the whole instance will be scanned") return command, nil } @@ -302,8 +302,11 @@ func (p *PaligoClient) listFolders() (*[]EmptyFolder, error) { var folders *ListFoldersResponse err = json.Unmarshal(body, &folders) + if err != nil { + return nil, fmt.Errorf("error parsing folders response: %w", err) + } - return &folders.Folders, err + return &folders.Folders, nil } func (p *PaligoClient) showFolder(folderId int) (*Folder, error) {