forked from sneak/bsdaily
cmd/bsdaily/main.go now only passes Version to cli.Main and exits with the status it returns, as REPO_POLICIES.md requires of cmd/. The cobra command, the flag rules and the date parsing moved unchanged into internal/cli, so flags, help text, error messages, exit status and the first log line stay as they were. The fallback to dev for an empty version moved with them into cli.Main. parseTargetDates is exported as ParseTargetDates so that a table test outside the package can reach it; the test never touches the filesystem or runs the extraction. README describes the new layout and TODO.md records the step. Model: opus-5-5
21 lines
513 B
Go
21 lines
513 B
Go
// Package main is the bsdaily command. It extracts one day, or a range
|
|
// of days, from the latest daily snapshot.
|
|
package main
|
|
|
|
import (
|
|
"os"
|
|
|
|
"git.eeqj.de/sneak/bsdaily/internal/cli"
|
|
)
|
|
|
|
// Version is the git tag or short commit, set at link time with
|
|
// -X main.Version=... by the Dockerfile and the Makefile. A build that sets
|
|
// nothing, or sets it empty, reports dev.
|
|
//
|
|
//nolint:gochecknoglobals // -X can only set a package-level variable
|
|
var Version string
|
|
|
|
func main() {
|
|
os.Exit(cli.Main(Version))
|
|
}
|