Skip to content

Commit

Permalink
make sure both flags aren't used at the same time
Browse files Browse the repository at this point in the history
Signed-off-by: Austin Abro <[email protected]>
  • Loading branch information
AustinAbro321 committed Jan 7, 2025
1 parent 8c3ba89 commit a3f0776
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/cmd/package.go
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,11 @@ func (o *PackageInspectOptions) PreRun(_ *cobra.Command, _ []string) {
// Run performs the execution of 'package inspect' sub-command.
func (o *PackageInspectOptions) Run(cmd *cobra.Command, args []string) error {
ctx := cmd.Context()

if pkgConfig.InspectOpts.ListImages && (pkgConfig.InspectOpts.SBOMOutputDir != "" || pkgConfig.InspectOpts.ViewSBOM) {
return fmt.Errorf("cannot use --sbom or --sbom-out and --list-images at the same time")
}

// NOTE(mkcp): Gets user input with message
src, err := choosePackage(ctx, args)
if err != nil {
Expand Down

0 comments on commit a3f0776

Please sign in to comment.