Skip to content

Commit

Permalink
fix(cli): show info message only when --scanners is available
Browse files Browse the repository at this point in the history
Signed-off-by: knqyf263 <[email protected]>
  • Loading branch information
knqyf263 committed Jun 27, 2024
1 parent 648ead9 commit cf7b7ff
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions pkg/flag/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -353,8 +353,10 @@ type Options struct {
}

// Align takes consistency of options
func (o *Options) Align() error {
o.enableSBOM()
func (o *Options) Align(f *Flags) error {
if f.ScanFlagGroup != nil && f.ScanFlagGroup.Scanners != nil {
o.enableSBOM()
}

if o.Compliance.Spec.ID != "" {
if viper.IsSet(ScannersFlag.ConfigName) {
Expand Down Expand Up @@ -738,7 +740,7 @@ func (f *Flags) ToOptions(args []string) (Options, error) {
}
}

if err := opts.Align(); err != nil {
if err := opts.Align(f); err != nil {
return Options{}, xerrors.Errorf("align options error: %w", err)
}

Expand Down

0 comments on commit cf7b7ff

Please sign in to comment.