From ca954f277f68c8477fa81ec71aa7ce39fea85f23 Mon Sep 17 00:00:00 2001 From: knqyf263 Date: Wed, 15 Nov 2023 11:36:31 +0900 Subject: [PATCH] chore: show a deprecation notice for '--scanners config' 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