Added support for list all packages flag in client (#1032)

* Added support for list all packages flag in client

This commit is to support --list-all_pkgs argument in client command
Example command: trivy -d client --list-all-pkgs --remote http://localhost:8080 ubuntu:18.04.

* Updated argument in client.md

* Fixed all format issues
This commit is contained in:
tonaim
2021-06-04 01:17:48 +05:30
committed by GitHub
parent fb19abd09a
commit e4c32cdb77
10 changed files with 94 additions and 62 deletions

View File

@@ -14,14 +14,13 @@ import (
type Option struct {
option.GlobalOption
option.ArtifactOption
ListAllPkgs bool
option.ImageOption
option.ReportOption
RemoteAddr string
token string
tokenHeader string
customHeaders []string
// this field is populated in Init()
CustomHeaders http.Header
}
@@ -42,6 +41,7 @@ func NewOption(c *cli.Context) (Option, error) {
token: c.String("token"),
tokenHeader: c.String("token-header"),
customHeaders: c.StringSlice("custom-headers"),
ListAllPkgs: c.Bool("list-all-pkgs"),
}, nil
}