github.com/anchore/syft@v1.38.2/cmd/syft/internal/options/unknowns.go (about)

     1  package options
     2  
     3  import (
     4  	"github.com/anchore/clio"
     5  	"github.com/anchore/syft/syft/cataloging"
     6  )
     7  
     8  type unknownsConfig struct {
     9  	RemoveWhenPackagesDefined  bool `json:"remove-when-packages-defined" yaml:"remove-when-packages-defined" mapstructure:"remove-when-packages-defined"`
    10  	ExecutablesWithoutPackages bool `json:"executables-without-packages" yaml:"executables-without-packages" mapstructure:"executables-without-packages"`
    11  	UnexpandedArchives         bool `json:"unexpanded-archives" yaml:"unexpanded-archives" mapstructure:"unexpanded-archives"`
    12  }
    13  
    14  var _ interface {
    15  	clio.FieldDescriber
    16  } = (*unknownsConfig)(nil)
    17  
    18  func (o *unknownsConfig) DescribeFields(descriptions clio.FieldDescriptionSet) {
    19  	descriptions.Add(&o.RemoveWhenPackagesDefined, `remove unknown errors on files with discovered packages`)
    20  	descriptions.Add(&o.ExecutablesWithoutPackages, `include executables without any identified packages`)
    21  	descriptions.Add(&o.UnexpandedArchives, `include archives which were not expanded and searched`)
    22  }
    23  
    24  func defaultUnknowns() unknownsConfig {
    25  	def := cataloging.DefaultUnknownsConfig()
    26  	return unknownsConfig{
    27  		RemoveWhenPackagesDefined:  def.RemoveWhenPackagesDefined,
    28  		ExecutablesWithoutPackages: def.IncludeExecutablesWithoutPackages,
    29  		UnexpandedArchives:         def.IncludeUnexpandedArchives,
    30  	}
    31  }