github.com/anchore/syft@v1.4.2-0.20240516191711-1bec1fc5d397/cmd/syft/internal/options/format_syft_json.go (about) 1 package options 2 3 import ( 4 "github.com/anchore/syft/syft/format/syftjson" 5 ) 6 7 type FormatSyftJSON struct { 8 Legacy bool `yaml:"legacy" json:"legacy" mapstructure:"legacy"` 9 Pretty *bool `yaml:"pretty" json:"pretty" mapstructure:"pretty"` 10 } 11 12 func DefaultFormatJSON() FormatSyftJSON { 13 return FormatSyftJSON{ 14 Legacy: false, 15 } 16 } 17 18 func (o FormatSyftJSON) config() syftjson.EncoderConfig { 19 var pretty bool 20 if o.Pretty != nil { 21 pretty = *o.Pretty 22 } 23 return syftjson.EncoderConfig{ 24 Legacy: o.Legacy, 25 Pretty: pretty, 26 } 27 }