Skip to content

Commit

Permalink
Revert "Return correct exit code on failure (AST-57074)"
Browse files Browse the repository at this point in the history
  • Loading branch information
sarahCx authored Oct 15, 2024
1 parent 8bcbea2 commit 7e3997c
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
1 change: 1 addition & 0 deletions internal/commands/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ func NewAstCLI(
chatCmd,
)

rootCmd.SilenceErrors = true
rootCmd.SilenceUsage = true
return rootCmd
}
Expand Down
7 changes: 0 additions & 7 deletions internal/commands/root_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 7e3997c

Please sign in to comment.