Answer architecture round 2: every error a custom CLI prints names it, the help marks where the name goes, the version line checks the main module first, and the README embed compiles for data without a table

This commit is contained in:
2026-10-11 20:56:17 +02:00
committed by Lillem4n
parent 9528ecd8b0
commit 5b2bb7e681
4 changed files with 38 additions and 22 deletions
+3 -3
View File
@@ -441,14 +441,14 @@ import (
"github.com/larvit/fejkdata/data"
)
//go:embed *.json *.tsv
//go:embed *.json
var mydata embed.FS
func main() { os.Exit(cli.Main(append(data.Modules(), mydata)...)) }
```
It takes `fejkdata`'s flags and exit codes, and names itself by the file it runs from in
its help and errors. `--no-shipped-data` leaves out the modules passed to `Main`, and
Add `*.tsv` to the embed where your data holds a table. The CLI takes `fejkdata`'s flags
and exit codes, and names itself by the file it runs from in its help and errors. `--no-shipped-data` leaves out the modules passed to `Main`, and
`--version` prints your module's version beside the fejkdata version it is built with.
`fejkdata`'s own `main` is `os.Exit(cli.Main(data.Modules()...))`.