mirror of
https://github.com/aquasecurity/trivy.git
synced 2025-12-22 23:26:39 -08:00
feat(option): warn "--list-all-pkgs" with "--format table" (#1632)
Co-authored-by: knqyf263 <knqyf263@gmail.com>
This commit is contained in:
@@ -77,6 +77,12 @@ func (c *Option) Init() (err error) {
|
||||
return err
|
||||
}
|
||||
|
||||
// "--list-all-pkgs" option is unavailable with "--format table".
|
||||
// If user specifies "--list-all-pkgs" with "--format table", we should warn it.
|
||||
if c.ListAllPkgs && c.Format == "table" {
|
||||
c.Logger.Warn(`"--list-all-pkgs" cannot be used with "--format table". Try "--format json" or other formats.`)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user