Repository navigation
Exit non-zero when arguments do not parse or a verb fails [patch] - #200
Merged
Merged
Conversation
Main returned void and every verb reported failures with Console.WriteLine, so a script could not tell that Ollama was down, the import file was missing, a required option was absent, or some images failed to describe. Fixes #167 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015PVg1hwPKWXb1nLDuTQgYR
Adds cases for an unsupported import or export extension, a blank search query, an invalid Ollama endpoint, an empty prompted path and --version, and gives every run an empty standard input so a prompt cannot block. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015PVg1hwPKWXb1nLDuTQgYR
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
Mainnow returnsint. It hands off to a newProgram.Run(args)that returns:Searchwithout-q).--helpand--versionstill return 0.BaseVerb.Failedflag.Failedis set on:ValidateArgsabort (no path or query given at the prompt)"No descriptions to export" and "no images found" still exit 0, because nothing went wrong in either case. The verbs'
void Runsignatures are unchanged, so the menu path and existing tests are untouched.Tests
New
ProgramTestsdriveProgram.Runfor each case: missing required option → 1, Ollama unreachable (-e http://127.0.0.1:1) → 1, missing import file → 1,Stats→ 0,--help→ 0. I checked that the tests catch the bug: withRunchanged back to always returning 0 (the old behaviour), the three non-zero tests fail. Full suite: 90 passed, 0 warnings.Fixes #167
🤖 Generated with Claude Code
https://claude.ai/code/session_015PVg1hwPKWXb1nLDuTQgYR
Generated by Claude Code