You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
cli: accept options before and between positional arguments
Commands read positionals as $args_ref->[N], but MooX::Cmd echoes the
raw argv back into execute() — so `archive --json 1` parsed "--json"
as the id list and died opaquely, `handoff --claim tester 1` looked up
task "--claim", and `show --last 2` crashed with zero positionals.
Worse, the extra-args guard counted only the leading dash-free run, so
`archive 1 --json 99` silently dropped the 99 while archiving task 1.
A positional_args extractor in Role::BoardAccess now subtracts option
tokens from argv using the command's own _options_data: value-taking
options swallow their following token (even flag-shaped values like
--append-body '--weird'), --opt=value forms and short aliases (-a, -t,
-y) are resolved, unknown dash tokens are defensively non-consuming.
The seven positional-taking commands read positionals from it, and
check_positional_args counts real positionals, closing the silent-drop
hole. Flags can sit anywhere, matching cobra's behavior in kanban-md.
Known residual: Getopt::Long abbreviations of value-taking options
(--cl tester) reject with a clean usage error instead of resolving —
safe, side-effect-free, and no worse than before.
Adds t/45-options-before-positionals.t.
Closes karr task #13.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GLsGFe6Vt98jHpCJmBwmMi
0 commit comments