feat(option): warn "--list-all-pkgs" with "--format table" (#1632)

Co-authored-by: knqyf263 <knqyf263@gmail.com>
This commit is contained in:
DmitriyLewen
2022-02-22 22:41:25 +06:00
committed by GitHub
parent 58ade462b4
commit c788676f87
4 changed files with 90 additions and 0 deletions

View File

@@ -56,6 +56,12 @@ func (c *Option) Init() 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 != "json" {
c.Logger.Warn(`"--list-all-pkgs" cannot be used with "--format table". Try "--format json" or other formats.`)
}
return nil
}