mirror of
https://github.com/anchore/syft.git
synced 2026-11-03 07:56:36 +01:00
with package id
This commit is contained in:
@@ -49,7 +49,7 @@ type artifact struct {
|
||||
Metadata interface{} `json:"metadata"`
|
||||
}
|
||||
|
||||
func (pres *Presenter) Present(output io.Writer, img *stereoscopeImg.Image, catalog pkg.Catalog) error {
|
||||
func (pres *Presenter) Present(output io.Writer, img *stereoscopeImg.Image, catalog *pkg.Catalog) error {
|
||||
tags := make([]string, len(img.Metadata.Tags))
|
||||
for idx, tag := range img.Metadata.Tags {
|
||||
tags[idx] = tag.String()
|
||||
|
||||
@@ -16,7 +16,7 @@ var Options = []Option{
|
||||
JSONPresenter,
|
||||
}
|
||||
|
||||
type Option uint
|
||||
type Option int
|
||||
|
||||
func ParseOption(userStr string) Option {
|
||||
switch strings.ToLower(userStr) {
|
||||
@@ -28,7 +28,7 @@ func ParseOption(userStr string) Option {
|
||||
}
|
||||
|
||||
func (o Option) String() string {
|
||||
if int(o) >= len(optionStr) {
|
||||
if int(o) >= len(optionStr) || o < 0 {
|
||||
return optionStr[0]
|
||||
}
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
)
|
||||
|
||||
type Presenter interface {
|
||||
Present(io.Writer, *image.Image, pkg.Catalog) error
|
||||
Present(io.Writer, *image.Image, *pkg.Catalog) error
|
||||
}
|
||||
|
||||
func GetPresenter(option Option) Presenter {
|
||||
|
||||
Reference in New Issue
Block a user