netwatch-server starts the server whenever its arguments are not exactly one of its two subcommand forms (cmd/netwatch-server/main.go on next; internal/cli/cli.go once #178 is merged). So netwatch-server check-cidr with no value, netwatch-server prepare-data-dir with two values, or a misspelt netwatch-server check-cdir 10.0.0.0/8 start the whole server, which then holds the port, instead of refusing the command line.
How to see it: netwatch-server check-cidr (no value) in the image: it logs its startup lines and listens, and exits only on a signal.
What is right: a command line the program does not understand is refused with a short usage message on stderr and a non-zero exit, as the two subcommands already refuse a bad value; only no arguments at all starts the server. Found while moving the dispatch for #160.
Severity: low. bin/entrypoint.sh always passes the right arguments.
Definition of done
With no arguments the server starts as now; check-cidr CIDR and prepare-data-dir DATA_DIR behave as now; any other arguments print a one-line usage message naming both forms to stderr and exit 2 without starting anything.
Tests cover a subcommand with too few and too many values and an unknown first argument.
README.md says how to run the two subcommands only if it already describes them; TODO.md updated in the same commit; commit title ends (closes #N) with this issue's number.
Model: opus-5-5
`netwatch-server` starts the server whenever its arguments are not exactly one of its two subcommand forms (`cmd/netwatch-server/main.go` on `next`; `internal/cli/cli.go` once https://git.eeqj.de/sneak/netwatch/pulls/178 is merged). So `netwatch-server check-cidr` with no value, `netwatch-server prepare-data-dir` with two values, or a misspelt `netwatch-server check-cdir 10.0.0.0/8` start the whole server, which then holds the port, instead of refusing the command line.
**How to see it**: `netwatch-server check-cidr` (no value) in the image: it logs its startup lines and listens, and exits only on a signal.
**What is right**: a command line the program does not understand is refused with a short usage message on stderr and a non-zero exit, as the two subcommands already refuse a bad value; only no arguments at all starts the server. Found while moving the dispatch for https://git.eeqj.de/sneak/netwatch/issues/160.
**Severity**: low. `bin/entrypoint.sh` always passes the right arguments.
## Definition of done
- [ ] With no arguments the server starts as now; `check-cidr CIDR` and `prepare-data-dir DATA_DIR` behave as now; any other arguments print a one-line usage message naming both forms to stderr and exit 2 without starting anything.
- [ ] Tests cover a subcommand with too few and too many values and an unknown first argument.
- [ ] `README.md` says how to run the two subcommands only if it already describes them; `TODO.md` updated in the same commit; commit title ends ` (closes #N)` with this issue's number.
Model: opus-5-5
clawbot
self-assigned this 2026-10-19 06:22:46 +02:00
Built in #187: any command line other than no arguments, check-cidr CIDR or prepare-data-dir DATA_DIR now gets a one-line usage message on stderr and exit code 2.
Model: opus-5-5
Built in https://git.eeqj.de/sneak/netwatch/pulls/187: any command line other than no arguments, `check-cidr CIDR` or `prepare-data-dir DATA_DIR` now gets a one-line usage message on stderr and exit code 2.
Model: opus-5-5
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
netwatch-serverstarts the server whenever its arguments are not exactly one of its two subcommand forms (cmd/netwatch-server/main.goonnext;internal/cli/cli.goonce #178 is merged). Sonetwatch-server check-cidrwith no value,netwatch-server prepare-data-dirwith two values, or a misspeltnetwatch-server check-cdir 10.0.0.0/8start the whole server, which then holds the port, instead of refusing the command line.How to see it:
netwatch-server check-cidr(no value) in the image: it logs its startup lines and listens, and exits only on a signal.What is right: a command line the program does not understand is refused with a short usage message on stderr and a non-zero exit, as the two subcommands already refuse a bad value; only no arguments at all starts the server. Found while moving the dispatch for #160.
Severity: low.
bin/entrypoint.shalways passes the right arguments.Definition of done
check-cidr CIDRandprepare-data-dir DATA_DIRbehave as now; any other arguments print a one-line usage message naming both forms to stderr and exit 2 without starting anything.README.mdsays how to run the two subcommands only if it already describes them;TODO.mdupdated in the same commit; commit title ends(closes #N)with this issue's number.Model: opus-5-5
Built in #187: any command line other than no arguments,
check-cidr CIDRorprepare-data-dir DATA_DIRnow gets a one-line usage message on stderr and exit code 2.Model: opus-5-5