Repository navigation
Exit 1 when a command that needs an argument is run without one - #18797
Conversation
The dispatcher intercepted a bare invocation of a command that declares required arguments, printed its help, and returned 0, reporting success for a command that never ran, unlike the binary itself which exits 1. Return 1 for that command-help case in both dispatch_fast_or_help and dispatch_or_help, while a bare group name still shows group help and returns 0.
[Medium impact] The PR appears safe to merge. SummaryThe PR makes bare commands with missing required arguments show help and exit 1. Bare group help and explicit help still exit 0.
Reviews (3) · Last reviewed commit: "Document that a bare required-argument c..." · Reviewed by Greptile |
The CLI suite still expected bare `omarchy share` and `omarchy menu share` to succeed, so under set -e the new exit status stopped it before the help checks. Capture the status of both and assert it is 1, keeping the usage text checks. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Pushed 6493ae6, which updates Tests, against Omarchy's rules on when a test is warranted: both Proved on a worker built from the Omarchy ISO:
Second opinion: Codex Medium. It found no defects, checked each claim in the docs line against |
Running a command that needs an argument without one, such as
omarchy tailscale send, prints its usage and exits 0, so a script reads it as success when nothing was sent. The dispatcher inbin/omarchyshows the command's help in place of running it and returns 0, though the command itself exits 1.Screenshots
Reproduce
omarchy tailscale send; echo EXIT:$?and press Enter.omarchy tailscale send <machine> [file...]prints, followed byEXIT:0.More cases
omarchy font setwith no font nameRelated
dispatch_fast_or_help