From a3895298dec37b291ae5968bd6c3aa7c155b3d44 Mon Sep 17 00:00:00 2001 From: Teppei Fukuda Date: Wed, 15 Nov 2023 13:20:40 +0900 Subject: [PATCH] chore: show a deprecation notice for `--scanners config` (#5587) Signed-off-by: knqyf263 --- pkg/flag/scan_flags.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/flag/scan_flags.go b/pkg/flag/scan_flags.go index 07623a04fe70..45e29cbdcd4a 100644 --- a/pkg/flag/scan_flags.go +++ b/pkg/flag/scan_flags.go @@ -1,6 +1,7 @@ package flag import ( + "github.com/aquasecurity/trivy/pkg/log" "github.com/aquasecurity/trivy/pkg/types" xstrings "github.com/aquasecurity/trivy/pkg/x/strings" ) @@ -41,7 +42,10 @@ var ( switch s { case "vulnerability": return string(types.VulnerabilityScanner) - case "config", "misconf", "misconfiguration": + case "misconf", "misconfiguration": + return string(types.MisconfigScanner) + case "config": + log.Logger.Warn("'--scanner config' is deprecated. Use '--scanner misconfig' instead. See https://github.com/aquasecurity/trivy/discussions/5586 for the detail.") return string(types.MisconfigScanner) } return s