fix(cli): correct three refusals from #5008
Merged
IM
5d ago+111+111+012345678901234567890123456789-30-30-01234567890123456789
Summary
Follow-up to #5008, from its review:
- An int flag refusal said
Expected integer, but the parser floors any number in range (open --timeout 1.5runs with 1). It now saysExpected number >= 1 (rounded down to an integer); accepted values do not change. Env and config refusals still say integer, since they refuse a fraction. gesture dragread","and"170,"as coordinates, because an empty segment became 0. Such endpoints now reach the selector checks.- The daemon's fill decoder answered every decode error with a generic message. Fill positionals sent straight to the daemon now get the CLI's refusal: its message, hint and
details.reasonfill_target_missing. A--text-stdinor--record-asfill keeps the reason, with a message that does not echo its positionals. Untyped decode failures keep the generic response.
Before / after
Base aecafaf30, head d3228751f. Output of the CLI parser, the drag payload reader and selector parser, and the daemon fill decoder:
$ open com.example.app --timeout 0.5
base: Invalid timeout: 0.5. Expected integer >= 1.
head: Invalid timeout: 0.5. Expected number >= 1 (rounded down to an integer).
$ gesture drag "170," @e2
base: drag_endpoint_is_coordinates: gesture drag takes a @ref or selector for source and destination, not coordinates: "170,".
head: Invalid selector term "170,", expected key=value
$ fill 136849 # positionals sent straight to the daemon
base: fill requires x y text, @ref text, or selector text (no reason)
head: fill_target_missing: fill needs <target> <text> but got one value, "136849". If a ref variable expanded to nothing, ...
Validation
- Head
d3228751f,check:affected --run --head,exactCommit: true: format, lint, typecheck, layering, fallow, build and vitest-related (441 tests) pass. - New tests cover
--timeout 1.5staying accepted and floored,",","170,"and"170 , "drag endpoints, andfillwith only its text through the daemon interaction handler, with and without--text-stdin/--record-as. Each fails with its fix reverted. - The
fill_target_missingrow inerror-reasons.mdstays put:scripts/reasons/generate.tsorders rows by table file path, then line.

Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.