diff --git a/cmd/grype/cli/commands/db_search.go b/cmd/grype/cli/commands/db_search.go index cd9893fdb6a..c6d1681742d 100644 --- a/cmd/grype/cli/commands/db_search.go +++ b/cmd/grype/cli/commands/db_search.go @@ -137,7 +137,12 @@ Global Flags: DBSearchVulnerabilities(app), ) - return app.SetupCommand(cmd, opts) + // prevent from being shown in the grype config + type configWrapper struct { + Opts *dbSearchMatchOptions `json:"-" yaml:"-" mapstructure:"-"` + } + + return app.SetupCommand(cmd, &configWrapper{opts}) } func runDBSearchMatches(opts dbSearchMatchOptions) error { diff --git a/cmd/grype/cli/commands/db_search_vuln.go b/cmd/grype/cli/commands/db_search_vuln.go index ef682f9ad65..f13b613920d 100644 --- a/cmd/grype/cli/commands/db_search_vuln.go +++ b/cmd/grype/cli/commands/db_search_vuln.go @@ -39,7 +39,7 @@ func DBSearchVulnerabilities(app clio.Application) *cobra.Command { DBOptions: *dbOptionsDefault(app.ID()), } - return app.SetupCommand(&cobra.Command{ + cmd := &cobra.Command{ Use: "vuln ID...", Aliases: []string{"vulnerability", "vulnerabilities", "vulns"}, Short: "Search for vulnerabilities within the DB (supports DB schema v6+ only)", @@ -56,7 +56,14 @@ func DBSearchVulnerabilities(app clio.Application) *cobra.Command { } return runDBSearchVulnerabilities(*opts) }, - }, opts) + } + + // prevent from being shown in the grype config + type configWrapper struct { + Opts *dbSearchVulnerabilityOptions `json:"-" yaml:"-" mapstructure:"-"` + } + + return app.SetupCommand(cmd, &configWrapper{opts}) } func runDBSearchVulnerabilities(opts dbSearchVulnerabilityOptions) error { diff --git a/test/cli/db_providers_test.go b/test/cli/db_providers_test.go index 79b1f346d8f..3e8d0e42cb7 100644 --- a/test/cli/db_providers_test.go +++ b/test/cli/db_providers_test.go @@ -25,7 +25,7 @@ func TestDBProviders(t *testing.T) { name: "db providers command help", args: []string{"db", "providers", "-h"}, assertions: []traitAssertion{ - assertInOutput("List vulnerability database providers"), + assertInOutput("List vulnerability providers that are in the database"), assertNoStderr, }, },