@@ -106,6 +106,20 @@ var (
106
106
ConfigName : "scan.show-suppressed" ,
107
107
Usage : "[EXPERIMENTAL] show suppressed vulnerabilities" ,
108
108
}
109
+ PkgTypesFlag = Flag [[]string ]{
110
+ Name : "pkg-types" ,
111
+ ConfigName : "pkg-types" ,
112
+ Default : types .PkgTypes ,
113
+ Values : types .PkgTypes ,
114
+ Usage : "comma-separated list of package types" ,
115
+ Aliases : []Alias {
116
+ {
117
+ Name : "vuln-type" ,
118
+ ConfigName : "vulnerability.type" ,
119
+ Deprecated : true , // --vuln-type was renamed to --pkg-types
120
+ },
121
+ },
122
+ }
109
123
)
110
124
111
125
// ReportFlagGroup composes common printer flag structs
@@ -125,6 +139,7 @@ type ReportFlagGroup struct {
125
139
Severity * Flag [[]string ]
126
140
Compliance * Flag [string ]
127
141
ShowSuppressed * Flag [bool ]
142
+ PkgTypes * Flag [[]string ]
128
143
}
129
144
130
145
type ReportOptions struct {
@@ -142,6 +157,7 @@ type ReportOptions struct {
142
157
Severities []dbTypes.Severity
143
158
Compliance spec.ComplianceSpec
144
159
ShowSuppressed bool
160
+ PkgTypes []string
145
161
}
146
162
147
163
func NewReportFlagGroup () * ReportFlagGroup {
@@ -160,6 +176,7 @@ func NewReportFlagGroup() *ReportFlagGroup {
160
176
Severity : SeverityFlag .Clone (),
161
177
Compliance : ComplianceFlag .Clone (),
162
178
ShowSuppressed : ShowSuppressedFlag .Clone (),
179
+ PkgTypes : PkgTypesFlag .Clone (),
163
180
}
164
181
}
165
182
@@ -183,6 +200,7 @@ func (f *ReportFlagGroup) Flags() []Flagger {
183
200
f .Severity ,
184
201
f .Compliance ,
185
202
f .ShowSuppressed ,
203
+ f .PkgTypes ,
186
204
}
187
205
}
188
206
@@ -252,6 +270,7 @@ func (f *ReportFlagGroup) ToOptions() (ReportOptions, error) {
252
270
Severities : toSeverity (f .Severity .Value ()),
253
271
Compliance : cs ,
254
272
ShowSuppressed : f .ShowSuppressed .Value (),
273
+ PkgTypes : f .PkgTypes .Value (),
255
274
}, nil
256
275
}
257
276
0 commit comments