@@ -25,6 +25,7 @@ import (
2525 "strings"
2626
2727 "github.com/docker/index-cli-plugin/internal"
28+ "github.com/docker/index-cli-plugin/sbom"
2829
2930 "github.com/moby/term"
3031 "github.com/pkg/errors"
@@ -38,7 +39,6 @@ import (
3839 "github.com/docker/cli/cli/command"
3940 "github.com/docker/index-cli-plugin/format"
4041 "github.com/docker/index-cli-plugin/query"
41- "github.com/docker/index-cli-plugin/sbom"
4242 "github.com/docker/index-cli-plugin/types"
4343)
4444
@@ -73,8 +73,8 @@ func NewRootCmd(name string, isPlugin bool, dockerCli command.Cli) *cobra.Comman
7373 config := dockerCli .ConfigFile ()
7474
7575 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
7878 )
7979
8080 logoutCommand := & cobra.Command {
@@ -181,14 +181,18 @@ func NewRootCmd(name string, isPlugin bool, dockerCli command.Cli) *cobra.Comman
181181 if err != nil {
182182 return err
183183 }
184+ if ! includeSbom {
185+ sb .Artifacts = nil
186+ }
184187 return sbom .UploadSbom (sb , workspace , apiKey )
185188 },
186189 }
187190 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" )
191194 uploadCommandFlags .BoolVar (& apiKeyStdin , "api-key-stdin" , false , "Atomist API key" )
195+ uploadCommandFlags .BoolVarP (& includeSbom , "sbom" , "s" , false , "Add SBOM" )
192196
193197 cveCommand := & cobra.Command {
194198 Use : "cve [OPTIONS] CVE_ID" ,
0 commit comments