Skip to content

Commit

Permalink
update make validate-cuclonedx-schema
Browse files Browse the repository at this point in the history
Signed-off-by: Christopher Phillips <christopher.phillips@anchore.com>
  • Loading branch information
spiffcs committed Apr 19, 2022
1 parent b68b6f9 commit b730abc
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion cmd/syft/cli/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 4 additions & 2 deletions cmd/syft/cli/options/packages.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand All @@ -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 {
Expand Down
2 changes: 0 additions & 2 deletions internal/config/application.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,6 @@ func loadConfig(v *viper.Viper, configPath string) error {
}

// start searching for valid configs in order...

// 1. look for .<appname>.yaml (in the current directory)
v.AddConfigPath(".")
v.SetConfigName("." + internal.ApplicationName)
Expand Down Expand Up @@ -245,6 +244,5 @@ func loadConfig(v *viper.Viper, configPath string) error {
} else if !errors.As(err, &viper.ConfigFileNotFoundError{}) {
return fmt.Errorf("unable to parse config=%q: %w", v.ConfigFileUsed(), err)
}

return nil
}

0 comments on commit b730abc

Please sign in to comment.