What's wrong
In ImageDescriber/Program.cs (~lines 22–28), Main returns void, and Parser.Default.ParseArguments(...).WithParsed(...) ignores parse errors. Each verb's Run reports a failure with Console.WriteLine and then returns normally.
Reproduced, and each of these exits with 0:
| Command |
Output |
Exit code |
Scan -p <dir> -e http://127.0.0.1:1 |
"Error: Ollama is not available" |
0 |
Import -i /nonexistent.csv |
"File not found" |
0 |
Search without -q |
"Required option 'q, query' is missing" |
0 |
A Scan where some images fail (the failure summary from #155) |
lists the failures |
0 |
Why it matters
A script, CI job or scheduled task that runs ImageDescriber Scan cannot tell that nothing, or only part of the folder, was described. OAICLI recently fixed the same problem in commit 5ecfd8e ("exit non-zero when the OpenAI API rejects a request").
Suggested fix
- Make
Main return int, and map WithNotParsed to 1.
- Have
BaseVerb.Run return a status (or set Environment.ExitCode) so that failures are non-zero: Ollama unavailable, missing or wrong input file, unwritable output, and a non-empty scan failure list.
Acceptance criteria
What's wrong
In
ImageDescriber/Program.cs(~lines 22–28),Mainreturnsvoid, andParser.Default.ParseArguments(...).WithParsed(...)ignores parse errors. Each verb'sRunreports a failure withConsole.WriteLineand then returns normally.Reproduced, and each of these exits with 0:
Scan -p <dir> -e http://127.0.0.1:1Import -i /nonexistent.csvSearchwithout-qScanwhere some images fail (the failure summary from #155)Why it matters
A script, CI job or scheduled task that runs
ImageDescriber Scancannot tell that nothing, or only part of the folder, was described. OAICLI recently fixed the same problem in commit 5ecfd8e ("exit non-zero when the OpenAI API rejects a request").Suggested fix
Mainreturnint, and mapWithNotParsedto1.BaseVerb.Runreturn a status (or setEnvironment.ExitCode) so that failures are non-zero: Ollama unavailable, missing or wrong input file, unwritable output, and a non-empty scan failure list.Acceptance criteria