From be445dcaa860e933e8eb6897ccea131e8c42e450 Mon Sep 17 00:00:00 2001 From: Christopher Phillips Date: Tue, 19 Apr 2022 11:32:14 -0400 Subject: [PATCH] update make validate-cuclonedx-schema Signed-off-by: Christopher Phillips --- cmd/syft/cli/commands.go | 2 +- cmd/syft/cli/options/packages.go | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/cmd/syft/cli/commands.go b/cmd/syft/cli/commands.go index b8373c1906bd..51ae5c63a2e1 100644 --- a/cmd/syft/cli/commands.go +++ b/cmd/syft/cli/commands.go @@ -29,7 +29,7 @@ func New() *cobra.Command { // e.g. pod.context = APPNAME_POD_CONTEXT v := viper.NewWithOptions(viper.EnvKeyReplacer(strings.NewReplacer(".", "_", "-", "_"))) - // since root is aliased as packages we need to construct this command first + // since root is aliased as the packages cmd we need to construct this command first packagesCmd := Packages(v, app, ro, po) // rootCmd is currently an alias for the packages command diff --git a/cmd/syft/cli/options/packages.go b/cmd/syft/cli/options/packages.go index 6e1e6d27527f..4aa32024c8cf 100644 --- a/cmd/syft/cli/options/packages.go +++ b/cmd/syft/cli/options/packages.go @@ -69,8 +69,6 @@ func (o *PackagesOptions) AddFlags(cmd *cobra.Command, v *viper.Viper) error { func bindPackageConfigOptions(flags *pflag.FlagSet, v *viper.Viper) error { // Formatting & Input options ////////////////////////////////////////////// - // note: output is not included since this configuration option is shared between multiple subcommands - if err := v.BindPFlag("package.cataloger.scope", flags.Lookup("scope")); err != nil { return err } @@ -83,6 +81,10 @@ func bindPackageConfigOptions(flags *pflag.FlagSet, v *viper.Viper) error { return err } + if err := v.BindPFlag("output", flags.Lookup("output")); err != nil { + return err + } + // Upload options ////////////////////////////////////////////////////////// if err := v.BindPFlag("anchore.host", flags.Lookup("host")); err != nil {