From 94b4b94864b822c19a42c75c7bfafb91281ec388 Mon Sep 17 00:00:00 2001 From: Francois Hardrouyere Date: Thu, 2 May 2024 16:26:30 +0200 Subject: [PATCH] preparse flags with `ParseFlags` --- x/programs/cmd/simulator/cmd/root.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/x/programs/cmd/simulator/cmd/root.go b/x/programs/cmd/simulator/cmd/root.go index d4888b7e42..69ed830b84 100644 --- a/x/programs/cmd/simulator/cmd/root.go +++ b/x/programs/cmd/simulator/cmd/root.go @@ -75,8 +75,8 @@ func NewRootCmd() *cobra.Command { cmd.SilenceErrors = true cmd.SetHelpCommand(&cobra.Command{Hidden: true}) - // pre-execute the command to pre-parse flags - err := cmd.Execute() + // pre-parse the command to pre-parse flags + err := cmd.ParseFlags(os.Args[1:]) if err != nil { fmt.Fprintln(os.Stderr, err) os.Exit(1)