Repo is positional on some commands and --repo on others, with no discoverable rule #34
Links
No links yet.
The implicit rule is “if the subcommand has no other positional, repo is positional; otherwise it is --repo” — but it is not stated anywhere and several commands break it outright.
$ anvil issue list --repo fangorn/anvil
error: unexpected argument '--repo' found
$ anvil issue view 1 --repo fangorn/anvil
(works)
$ anvil requirement list --repo fangorn/anvil
(works — repo IS a flag here)
Positional [REPO]: repo view, pr list, issue list, epic list, ci list, ci run, ci secrets, commit list, branch list, release list, deploy list, deploy status, deploy env list, agent list, label list, board list, milestone list, issue milestones.
Flag --repo, including read-only commands with no competing positional (so they break the rule): requirement list (requirement.rs:57-59), requirement matrix (:134-136), requirement status (:233-235), requirement export (:185-187), board init (board.rs:21-23).
ci run (ci.rs:37-39) is the only mutation taking repo positionally.
The trap this creates
The natural typing gets swallowed by the positional slot:
$ anvil issue list closed
Error: config I/O error: invalid repo format 'closed' — expected 'org/repo'
anvil pr list merged fails the same way.
Related shape splits
- Issue number is positional in 17 places but a flag in
label add/label remove(label.rs:63-65) - Label name is a flag in
create/add/removeand positional inedit/delete(label.rs:24,38,56,67,79) - Requirement ID is
--requirement-idoncreate(requirement.rs:317) and positional everywhere else
Suggested fix
Accept --repo everywhere as the canonical form, keep the positional as an optional alias where it already exists, and validate that a positional repo actually looks like org/repo before treating it as one.
Found during a CLI-wide consistency audit.