From d5187caeba76db7b34a10939006c0496943ffa66 Mon Sep 17 00:00:00 2001 From: Juanma Barea Date: Mon, 18 Nov 2024 10:41:14 +0100 Subject: [PATCH] Changes maven debug argument type Signed-off-by: Juanma Barea --- cmd/openrewrite.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cmd/openrewrite.go b/cmd/openrewrite.go index 0a05a78..fcbc540 100644 --- a/cmd/openrewrite.go +++ b/cmd/openrewrite.go @@ -21,7 +21,7 @@ type openRewriteCommand struct { log logr.Logger cleanup bool mavenSettingsFile string - mavenDebugLog string + mavenDebugLog bool } func NewOpenRewriteCommand(log logr.Logger) *cobra.Command { @@ -62,7 +62,7 @@ func NewOpenRewriteCommand(log logr.Logger) *cobra.Command { openRewriteCommand.Flags().StringVarP(&openRewriteCmd.goal, "goal", "g", "dryRun", "target goal") openRewriteCommand.Flags().StringVarP(&openRewriteCmd.input, "input", "i", "", "path to application source code directory") openRewriteCommand.Flags().StringVarP(&openRewriteCmd.mavenSettingsFile, "maven-settings", "s", "", "path to a custom maven settings file to use") - openRewriteCommand.Flags().StringVarP(&openRewriteCmd.mavenDebugLog, "maven debug log level", "x", "", "set maven log to debug") + openRewriteCommand.Flags().BoolVarP(&openRewriteCmd.mavenDebugLog, "maven debug log level", "x", false, "enable Maven debug logging") return openRewriteCommand } @@ -153,9 +153,9 @@ func (o *openRewriteCommand) Run(ctx context.Context) error { o.log.Info("using custom maven settings file", "path", o.mavenSettingsFile) args = append(args, "-s", o.mavenSettingsFile) } - if o.mavenDebugLog != "" { + if o.mavenDebugLog { o.log.Info("Setting Maven log to debug") - args = append(args, "-x") + args = append(args, "-X") } err := container.NewContainer().Run(