@@ -25,6 +25,7 @@ import (
25
25
"strings"
26
26
27
27
"github.com/docker/index-cli-plugin/internal"
28
+ "github.com/docker/index-cli-plugin/sbom"
28
29
29
30
"github.com/moby/term"
30
31
"github.com/pkg/errors"
@@ -38,7 +39,6 @@ import (
38
39
"github.com/docker/cli/cli/command"
39
40
"github.com/docker/index-cli-plugin/format"
40
41
"github.com/docker/index-cli-plugin/query"
41
- "github.com/docker/index-cli-plugin/sbom"
42
42
"github.com/docker/index-cli-plugin/types"
43
43
)
44
44
@@ -73,8 +73,8 @@ func NewRootCmd(name string, isPlugin bool, dockerCli command.Cli) *cobra.Comman
73
73
config := dockerCli .ConfigFile ()
74
74
75
75
var (
76
- output , ociDir , image , workspace string
77
- apiKeyStdin , includeCves , includeBaseImages , remediate bool
76
+ output , ociDir , image , workspace string
77
+ apiKeyStdin , includeCves , includeBaseImages , remediate , includeSbom bool
78
78
)
79
79
80
80
logoutCommand := & cobra.Command {
@@ -181,14 +181,18 @@ func NewRootCmd(name string, isPlugin bool, dockerCli command.Cli) *cobra.Comman
181
181
if err != nil {
182
182
return err
183
183
}
184
+ if ! includeSbom {
185
+ sb .Artifacts = nil
186
+ }
184
187
return sbom .UploadSbom (sb , workspace , apiKey )
185
188
},
186
189
}
187
190
uploadCommandFlags := uploadCommand .Flags ()
188
- uploadCommandFlags .StringVar (& image , "image" , "" , "Image reference to index" )
189
- uploadCommandFlags .StringVar (& ociDir , "oci-dir" , "" , "Path to image in OCI format" )
190
- uploadCommandFlags .StringVar (& workspace , "workspace" , "" , "Atomist workspace" )
191
+ uploadCommandFlags .StringVarP (& image , "image" , "i " , "" , "Image reference to index" )
192
+ uploadCommandFlags .StringVarP (& ociDir , "oci-dir" , "d " , "" , "Path to image in OCI format" )
193
+ uploadCommandFlags .StringVarP (& workspace , "workspace" , "w " , "" , "Atomist workspace" )
191
194
uploadCommandFlags .BoolVar (& apiKeyStdin , "api-key-stdin" , false , "Atomist API key" )
195
+ uploadCommandFlags .BoolVarP (& includeSbom , "sbom" , "s" , false , "Add SBOM" )
192
196
193
197
cveCommand := & cobra.Command {
194
198
Use : "cve [OPTIONS] CVE_ID" ,
0 commit comments