depot: replace --target local with --out DIR #67

Merged
archvillainette merged 1 commits from depot-out-flag into main 2026-07-28 11:07:59 +00:00
Owner

Closes #66.

depot status and depot get chose a depot tree on disk with --target local, taking the root from DEPOT_DIR. One decision, two flags — and --target local with no directory anywhere was valid but meaningless.

Now they take --out DIR, matching the crucible nwsync surface. --target names remote backends only (bunny|cdn). Passing both exits 64.

  • --target local stays as a deprecated alias for --out $DEPOT_DIR, listed in the hidden-alias table in docs/command-surface.md. Nothing in wrappers/ calls depot, but the three repos in wrappers/consumers.txt are out of reach from here, so the alias stays.
  • status --source was already unused; it now warns "ignored; use --out DIR" instead of accepting silently.
  • Fixes a real parse bug found on the way: the documented depot get <sha> <dest> --target cdn form never parsed its flags, because Go's flag package stops at the first positional. Positionals are split off by hand now; both orders are tested.
  • Registry usage strings and docs/command-surface.md synced — that doc still said depot was unwired.

Not converted: push --source and pull --dest. Neither is --target local; one names a read source, the other a remote pull's destination. Say the word if they should become --out too.

go test ./... green.

🤖 Generated with Claude Code

Closes #66. `depot status` and `depot get` chose a depot tree on disk with `--target local`, taking the root from `DEPOT_DIR`. One decision, two flags — and `--target local` with no directory anywhere was valid but meaningless. Now they take `--out DIR`, matching the crucible nwsync surface. `--target` names remote backends only (`bunny|cdn`). Passing both exits 64. - `--target local` stays as a deprecated alias for `--out $DEPOT_DIR`, listed in the hidden-alias table in `docs/command-surface.md`. Nothing in `wrappers/` calls depot, but the three repos in `wrappers/consumers.txt` are out of reach from here, so the alias stays. - `status --source` was already unused; it now warns "ignored; use --out DIR" instead of accepting silently. - Fixes a real parse bug found on the way: the documented `depot get <sha> <dest> --target cdn` form never parsed its flags, because Go's `flag` package stops at the first positional. Positionals are split off by hand now; both orders are tested. - Registry usage strings and `docs/command-surface.md` synced — that doc still said depot was unwired. Not converted: `push --source` and `pull --dest`. Neither is `--target local`; one names a read source, the other a remote pull's destination. Say the word if they should become `--out` too. `go test ./...` green. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
archvillainette added 1 commit 2026-07-28 08:53:44 +00:00
feat(depot): select a depot tree on disk with --out DIR
ci / ci (pull_request) Successful in 3m20s
6bbc2c3a83
`depot status` and `depot get` chose a local depot tree with `--target
local`, resolving the root from `DEPOT_DIR`. That split one decision over
two flags and left `--target local` valid with no directory anywhere.

Adopt the nwsync convention instead: `--out DIR` names the tree on disk in
the same breath as choosing it, and `--target` now names remote backends
only. The two are mutually exclusive. `--target local` stays as a
deprecated alias for `--out $DEPOT_DIR` so existing callers keep working,
and `status --source` is now ignored with a warning instead of silently
accepted.

Also split positionals off by hand in `depot get`, so the documented
`depot get <sha> <dest> --out DIR` form parses its flags at all — Go's
flag package stops at the first positional.

Closes #66
archvillainette scheduled this pull request to auto merge when all checks succeed 2026-07-28 11:07:37 +00:00
xtul approved these changes 2026-07-28 11:07:57 +00:00
archvillainette merged commit 22eecd1a41 into main 2026-07-28 11:07:59 +00:00
archvillainette deleted branch depot-out-flag 2026-07-28 11:07:59 +00:00
Sign in to join this conversation.