Add --version and --help Flags to git-remote-entire

Claude Code·Opus 4.8[1m]·toothbrush·3mo ago·42min·3 Checkpoints·3 file changes·+74/-3·29K tokens

Make a branch off origin/main. I want the git-remote-entire helper to have two extra flags:

--version --help

don't use cobra or anything fancy, the ONLY way their behaviour should activate is if ARGC == 1 and ARGV[0] == "--flag". ok?

version should print the versioninfo like the ./cmd/entire does, and help should just be a small text saying:

''' git-remote-entire vXXX

This is a helper which Git calls when encountering entire://... URLs. For more information see https://github.com/entireio/cli. '''

3mo ago·5m

Done. Branch git-remote-entire-info-flags off origin/main, committed (not pushed).

What it does:

  • git-remote-entire --version → prints version + Go/OS-arch, same info as entire version.
  • git-remote-entire --help → prints your exact help text (vXXX rendered as v<version>).
  • Both only fire when it's the single argument (len(args)==2 && args[1]==flag). Git's real invocation passes <remote> <url> (two args), so no collision. No cobra — plain switch.

Notes / tradeoffs:

  • First line of --version is labeled git-remote-entire <version> (the running binary), not Entire CLI — same fields as ./cmd/entire, just the accurate binary name.
  • In a local dev build --help reads git-remote-entire vdev; a real release stamps v0.6.x.
  • Lint: lint:go is clean. The lint:shellcheck failure is pre-existing in mise-tasks/release (untouched by me).

Push when ready: git push -u origin git-remote-entire-info-flags.

i pushed. make a PR, very succinct please.

3mo ago·49.4s

Working tree is clean and the branch is 3 ahead. Something committed my test edit. Let me check the log:

i fixed up the remote branch. PR pleas.

3mo ago·6.7s

PR please, no git ops.

3mo ago·14.0s

Hm. Pretend it didn't exist and overwrite the description and title.

3mo ago·14.8s

Done — overwrote title and description on https://github.com/entireio/cli/pull/1353

I closed the PR because some bot owned it. Make it again

3mo ago·14.7s

I literally tried it, it works. this comment sounds like bullshit https://github.com/entireio/cli/pull/1354#discussion_r3352720221

3mo ago·31.8s

Bottom line: your code is correct. The bot isn't disputing behavior — it's nitpicking the comment's word "(two args)" sitting right next to a len(args)==2 check. That's the only real friction: two different counting conventions in the same breath.

  • git-remote-entire <remote> <url> → os.Args = [prog, remote, url] → len==3 → skips the block. ✅
  • git-remote-entire --version → os.Args = [prog, --version] → len==2 → triggers. ✅
  • So "(two args)" means the two git-supplied args (remote + url); the len==2 means one user arg + argv[0]. Both true, different frames — which is exactly why a reader trips.

It works as you saw. The bot's only fair point is the comment can be misread. Two options:

  1. Leave it — it's pedantic, you've already dismissed the sibling comments.
  2. One-word reword so the counts can't be conflated, e.g. drop "(two args)" → "(so os.Args has length 3)".

Want me to apply #2, or reply to the bot dismissing it?

apply 2.

3mo ago·1m

Done. Reworded to state os.Args lengths explicitly (2 for sole flag, 3 for git's invocation). Committed c5aaaf0e16, not pushed.