cli: trim basic help, drop invented flag, parallelize by default

Surface area, not the machinery, was the problem: 16 flags crowded the
bare --help. Re-tag so basic shows only the 10 outcome-changing flags;
every other flag still works behind --help=<group>.

- cut --bt-metadata-timeout, an invented flag with no real counterpart. Keep
  its 60s magnet-metadata stall as a fixed internal default (bt.go), not a
  user knob.
- fix the parallelism footgun: a bare `got URL` used min(split,x)=1
  connection. When -x is unset, let --split drive per-host connections
  (capped at 16), so `got URL` gets 5 and `-s16` gets 16. An explicit -x
  is honored verbatim, including -x1. Locked by TestHTTPConnDefault.
- -s is the per-download speed dial now, so it moves to basic; -x (a
  per-server cap) moves to the http group. -j help says "files at once,
  not connections within one file".
This commit is contained in:
2026-06-21 15:10:57 +09:00
parent 2d99c39604
commit 3eb2d5ffcb
6 changed files with 82 additions and 55 deletions

View File

@@ -15,15 +15,17 @@ Needs Go 1.25+.
## Usage
```sh
# HTTP download with 16 connections
got -x16 -s16 https://example.com/big.iso
# HTTP download: parallel out of the box (5 connections); -s turns it up
got https://example.com/big.iso
got -s16 https://example.com/big.iso
# resume an interrupted download
got -c https://example.com/big.iso
# one file from several mirrors (connections spread across servers,
# a dead mirror falls over); -Z downloads them as separate files instead
got -x4 https://a.example/big.iso https://b.example/big.iso
# a dead mirror falls over); -Z downloads them as separate files instead.
# -x caps connections per server when mirroring.
got -s16 -x4 https://a.example/big.iso https://b.example/big.iso
# a torrent or magnet; seed for 30 minutes after finishing
got --seed-time=30 ubuntu.torrent
@@ -42,9 +44,9 @@ Run `got --help` (or `--help=all`) for every option.
| `-d, --dir` | output directory | `.` |
| `-o, --out` | output filename | from URL |
| `-c, --continue` | resume a partial download | false |
| `-x, --max-connection-per-server` | connections to one server (116) | 1 |
| `-s, --split` | split a download into N connections | 5 |
| `-j, --max-concurrent-downloads` | downloads at once | 5 |
| `-s, --split` | connections per download (the speed dial) | 5 |
| `-x, --max-connection-per-server` | cap connections per server (116) | 1 (= split when unset) |
| `-j, --max-concurrent-downloads` | files downloaded at once | 5 |
| `--max-overall-download-limit` | global speed cap | 0 (off) |
| `--checksum` | verify the finished file: `TYPE=DIGEST` (sha-256, sha-1, …) | |
| `--seed-time` | minutes to seed after a torrent finishes | by ratio |