From 7e3997c56fb385b27949abb0683856ad746702cc Mon Sep 17 00:00:00 2001 From: sarahCx Date: Tue, 15 Oct 2024 09:49:59 +0300 Subject: [PATCH] Revert "Return correct exit code on failure (AST-57074)" --- internal/commands/root.go | 1 + internal/commands/root_test.go | 7 ------- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/internal/commands/root.go b/internal/commands/root.go index a440f165c..d6fb1174a 100644 --- a/internal/commands/root.go +++ b/internal/commands/root.go @@ -211,6 +211,7 @@ func NewAstCLI( chatCmd, ) + rootCmd.SilenceErrors = true rootCmd.SilenceUsage = true return rootCmd } diff --git a/internal/commands/root_test.go b/internal/commands/root_test.go index 9fee22ce1..ad14bc490 100644 --- a/internal/commands/root_test.go +++ b/internal/commands/root_test.go @@ -140,13 +140,6 @@ func TestFilterTagStateAndSeverityValues(t *testing.T) { assert.NilError(t, err) } -func TestCreateCommand_WithInvalidFlag_ShouldReturnExitCode1(t *testing.T) { - args := []string{"g"} - cmd := createASTTestCommand() - err := executeTestCommand(cmd, args...) - assert.Error(t, err, "unknown command \"g\" for \"cx\"") -} - func executeTestCommand(cmd *cobra.Command, args ...string) error { fmt.Println("Executing command with args ", args) cmd.SetArgs(args)