mirror of
https://github.com/aquasecurity/trivy.git
synced 2025-12-22 07:10:41 -08:00
feat(repo): add support for branch, commit, & tag (#2494)
Co-authored-by: knqyf263 <knqyf263@gmail.com>
This commit is contained in:
committed by
GitHub
parent
783e7cfe0c
commit
30c9f90bf8
@@ -51,6 +51,7 @@ type Flags struct {
|
||||
LicenseFlagGroup *LicenseFlagGroup
|
||||
MisconfFlagGroup *MisconfFlagGroup
|
||||
RemoteFlagGroup *RemoteFlagGroup
|
||||
RepoFlagGroup *RepoFlagGroup
|
||||
ReportFlagGroup *ReportFlagGroup
|
||||
SBOMFlagGroup *SBOMFlagGroup
|
||||
ScanFlagGroup *ScanFlagGroup
|
||||
@@ -68,6 +69,7 @@ type Options struct {
|
||||
LicenseOptions
|
||||
MisconfOptions
|
||||
RemoteOptions
|
||||
RepoOptions
|
||||
ReportOptions
|
||||
SBOMOptions
|
||||
ScanOptions
|
||||
@@ -209,6 +211,9 @@ func (f *Flags) groups() []FlagGroup {
|
||||
if f.RemoteFlagGroup != nil {
|
||||
groups = append(groups, f.RemoteFlagGroup)
|
||||
}
|
||||
if f.RepoFlagGroup != nil {
|
||||
groups = append(groups, f.RepoFlagGroup)
|
||||
}
|
||||
return groups
|
||||
}
|
||||
|
||||
@@ -302,6 +307,10 @@ func (f *Flags) ToOptions(appVersion string, args []string, globalFlags *GlobalF
|
||||
opts.RemoteOptions = f.RemoteFlagGroup.ToOptions()
|
||||
}
|
||||
|
||||
if f.RepoFlagGroup != nil {
|
||||
opts.RepoOptions = f.RepoFlagGroup.ToOptions()
|
||||
}
|
||||
|
||||
if f.ReportFlagGroup != nil {
|
||||
opts.ReportOptions, err = f.ReportFlagGroup.ToOptions(output)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user