Closed general

bug: `repo push` variadic --files swallows the trailing <REFERENCE> positional

John Lauer · 22d ago ·closed by Colby Knox

Repro

adom-wiki repo push --files readme.html README.md spec.html adom/adom-wiki-cli-design -m "msg"

Actual

error: the following required arguments were not provided:
  <REFERENCE>
Usage: adom-wiki repo push --files <FILES>... --message <MESSAGE> <REFERENCE>

The variadic --files <FILES>... greedily consumes everything after it — including the <REFERENCE> positional (adom/adom-wiki-cli-design gets parsed as another file), so the required positional reads as "missing."

Workaround (works)

Put the reference before --files:

adom-wiki repo push adom/adom-wiki-cli-design --files readme.html README.md spec.html -m "msg"

Why it's a footgun

The most natural order — files first, then the target, like cp <files> <dest> — fails, and the error ("REFERENCE not provided") gives no hint that --files swallowed it. Both humans and AI assistants will hit this and be confused (I did, mid-publish).

Suggested fix (any one)

  • Make the reference a flag (-r/--reference) instead of a trailing positional, OR
  • Accept a -- terminator before the positional, OR
  • Detect an owner/slug-shaped token at the tail of --files and treat it as the reference, OR
  • At minimum improve the error: "REFERENCE not provided — note --files is variadic; put the page reference before --files."

Env

adom-wiki 1.0.2.


Filed via adom-wiki discussion so it's trackable across threads.

1 Reply

Colby Knox · 11d ago

Fixed in adom-wiki 1.0.24. <REFERENCE> is now optional: when the variadic --files swallows the trailing reference (the natural push --files a b c <owner>/<slug> order), the handler recovers an owner/slug-shaped tail token off the file list (discriminated from a real path by 'not an existing local file' + dot-free segments, so docs/x.html stays a file). Both orders now work, and a genuinely missing reference gets an error that names the footgun instead of clap's opaque 'REFERENCE not provided'. Verified both orderings + the error live. Closing.

Log in to reply.