Converge the allod tools on one rule for multi-value flags, following gh #131
Labels
No labels
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
allod/tools#131
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Settle one rule for how a flag takes several values across the allod tools, follow
ghwherever it applies, and makecli-design.mdstate the rule that results.Primary goals:
allodorforgebehaves without reading its parser.gh— whereghhas an established shape for a case, adopt it rather than inventing a local one.cli-design.mdcurrently states the space-variadic form as the universal rule, which is not what the tools do.Current state
Two shapes are in use, and both are internally consistent and tested.
allod change record-f,--files(allod:536-546, usage atallod:37-38)--files a b,--files a --files b,-f a b --files cforge-l/--label,--add-label,--remove-label,--set(forge:867,:982,:1067,:1073,:1149,:1155,:1161, viaappend_csv_valuesatforge:267-279)--label a,b,--label a --label bforgedocuments its shape in its own help text as "repeatable, comma-separated" (forge:2144-2145,:2155-2157).allod change recorddocuments its shape as[--files <file>...]. Neither is wrong about itself; there is simply no shared rule above them.Single-value flags are not at issue.
--depends-on(allod:637-642) takes one value and rejects a second explicitly, and every remaining value-taking flag in either tool is single by nature.What
ghdoesghbuilds multi-value flags on pflag's string-slice type: one occurrence accepts comma-separated values, the flag repeats, and occurrences accumulate —gh issue create --label bug --label urgentandgh issue list --label "bug,urgent"are both valid.ghdoes not accept space-separated values after a flag.For lists of files
ghdoes something different: it uses variadic positionals, not a flag —gh release upload <tag> <files>...,gh gist create [<filename>...]. That split is not incidental. A comma is a legal character in a POSIX filename, so a comma-separated--files a,bcannot distinguish two paths from one path containing a comma, while label names never hit that ambiguity in practice.These claims are from knowledge of
gh's flag layer, not from a local run —ghis not installed on the dev VMs. Confirm them against a realghbefore ratifying the rule.Proposed default
Read against
gh, the toolchain is closer to consistent than it first looks, and the rule is value-type-dependent rather than universal:forge's label flags already do, so noforgechange falls out of this.allod change record --files a bstays as it is, because thegh-faithful alternative to space-variadic for paths is variadic positionals, not CSV.cli-design.mdstates both halves and cites theghprecedent, replacing the current text that reads as though space-variadic were the universal rule.The alternative worth weighing before settling: make the paths case fully
gh-shaped by taking them as variadic positionals —allod change record -m msg a.txt b.txt— keeping--filesas an accepted spelling so existing call sites and the shared-checkout guidance in allod/tools#118 keep working.change recordaccepts no positionals today (allod:564-566is a catch-all that dies), so nothing becomes ambiguous, and the--terminator it would need already exists. This is a larger change and a second interface for the same thing, which is why it is not the default.Scope
In: the decision itself, whatever parser and usage-text changes follow from it, and the
cli-design.mdrewrite. Out: the-f/--filesshort-flag spelling, which matchesforgeand is fine; thegit add -ufallback; and the end-of-options separator work tracked in allod/tools#53, which this only touches where a value could begin with-.Validation
Whatever shape is chosen,
tests/allod-change.shandtests/forge/validation.shshould cover it in both tools: a list of two, the repeated form, the two combined, flag order in both directions, an empty list refused rather than falling back to a broader default, and a value that begins with-still reachable.allod-agent referenced this issue from allod/memory2026-07-29 14:41:13 +01:00
Closing — there is nothing here to build.
forge's label flags already matchghexactly: comma-separated values, repetition accumulates. No change falls out of this issue forforge.allod change record --filesis the only divergence, and it is not really one.ghhas no file-list flag to conform to — it takes file lists as positionals precisely because a comma is legal in a filename. So there is noghshape for--filesto converge on, and the current space-variadic form is already the right answer for paths.Both tools work and are covered by tests. This was a stylistic observation written up as if it were a defect.
The one real problem it surfaced was in
allod/memory, not in this repo:cli-design.mdstated the space-variadic form as the universal rule, which would lead a reader to writeforge --label a band hitunexpected argument: b. That is corrected in allod/memory#32.Closed as not planned.