Files
netwatch/cmd/netwatch-server/main.go
T
sneak 1a7966b97a
check / check (push) Canceled after 0s
main() is one call into internal/cli (closes #160)
cmd/netwatch-server/main.go parsed the command line, ran the check-cidr
and prepare-data-dir subcommands and built the fx application itself;
the Go style guide puts all of that in internal/ or pkg/. The new
package internal/cli does it, with the same arguments, messages and
exit codes, and main() is now os.Exit(cli.Main(Appname, Version,
os.Args[1:])). Appname and Version stay in main, where the build sets
Version. Each subcommand writes its error to a writer it is given, and
prepare-data-dir also takes the volume and the user's name, so the new
unit tests give it a temporary directory and the user they run as.

Model: opus-5-5
2026-10-19 04:19:31 +00:00

20 lines
339 B
Go

// Package main is the entry point for netwatch-server; package cli
// does the work.
package main
import (
"os"
"sneak.berlin/go/netwatch/internal/cli"
)
//nolint:gochecknoglobals // set via ldflags at build time
var (
Appname = "netwatch-server"
Version string
)
func main() {
os.Exit(cli.Main(Appname, Version, os.Args[1:]))
}