diff --git a/cmd/fuzz_flags.go b/cmd/fuzz_flags.go index abc89190..56d17897 100644 --- a/cmd/fuzz_flags.go +++ b/cmd/fuzz_flags.go @@ -61,15 +61,14 @@ func addFuzzFlags() error { fmt.Sprintf("print the execution trace for every element in a shrunken call sequence instead of only the last element (unless a config file is provided, default is %t)", defaultConfig.Fuzzing.Testing.TraceAll)) // Logging color - fuzzCmd.Flags().Bool("no-color", false, "disabled colored terminal output") + fuzzCmd.Flags().Bool("no-color", false, "disables colored terminal output") // Enable stop on failed test - fuzzCmd.Flags().Bool("fail-fast", false, "enabled stop on failed test") + fuzzCmd.Flags().Bool("fail-fast", false, "enables stop on failed test") // Exploration mode fuzzCmd.Flags().Bool("explore", false, "enables exploration mode") - return nil } @@ -171,21 +170,22 @@ func updateProjectConfigWithFuzzFlags(cmd *cobra.Command, projectConfig *config. } } - - // Update StopOnFailedTest enablement + // Update stop on failed test feature if cmd.Flags().Changed("fail-fast") { - projectConfig.Fuzzing.Testing.StopOnFailedTest, err = cmd.Flags().GetBool("fail-fast") + failFast, err := cmd.Flags().GetBool("fail-fast") if err != nil { return err } + projectConfig.Fuzzing.Testing.StopOnFailedTest = failFast + } // Update configuration to exploration mode if cmd.Flags().Changed("explore") { - exploreBool, err := cmd.Flags().GetBool("explore") + explore, err := cmd.Flags().GetBool("explore") if err != nil { return err } - if exploreBool { + if explore { projectConfig.Fuzzing.Testing.StopOnFailedTest = false projectConfig.Fuzzing.Testing.StopOnNoTests = false projectConfig.Fuzzing.Testing.AssertionTesting.Enabled = false