Skip to content

Return SUCCESS when list commands find no results#149

Merged
joetannenbaum merged 1 commit intomainfrom
fix/empty-list-exit-code
Apr 21, 2026
Merged

Return SUCCESS when list commands find no results#149
joetannenbaum merged 1 commit intomainfrom
fix/empty-list-exit-code

Conversation

@joetannenbaum
Copy link
Copy Markdown
Collaborator

List commands were inconsistent: --json mode exited 0 on empty results (outputJsonIfWanted throws SUCCESS after writing), but interactive mode exited 1 with a warning. Normalizing toward 0 in both cases since an empty list is a valid state, not an error. Matches how gh, kubectl, doctl, and ls behave on empty results.

The "No X found." warning still prints in interactive mode so users aren't left wondering.

Closes #44

@joetannenbaum joetannenbaum merged commit 2645d6b into main Apr 21, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: Empty list commands return SUCCESS in JSON/non-interactive mode

1 participant