tidying things up and getting started

This commit is contained in:
2025-07-03 22:31:51 +01:00
parent ab9159e6ce
commit 045e4de8db
141 changed files with 9189 additions and 11723 deletions

43
main.go Normal file
View File

@@ -0,0 +1,43 @@
package main
import (
"fmt"
"github.com/pkg/profile"
"net/http"
"not.realy.lol/chk"
"not.realy.lol/config"
"not.realy.lol/log"
"not.realy.lol/lol"
"not.realy.lol/version"
"os"
)
func main() {
var err error
var cfg *config.C
if cfg, err = config.New(); chk.T(err) {
if err != nil {
fmt.Fprintf(os.Stderr, "ERROR: %s\n\n", err)
}
config.PrintHelp(cfg, os.Stderr)
os.Exit(0)
}
if config.GetEnv() {
config.PrintEnv(cfg, os.Stdout)
os.Exit(0)
}
if config.HelpRequested() {
config.PrintHelp(cfg, os.Stderr)
os.Exit(0)
}
if cfg.Pprof {
defer profile.Start(profile.MemProfile).Stop()
go func() {
chk.E(http.ListenAndServe("127.0.0.1:6060", nil))
}()
}
log.I.F(
"starting %s %s; log level: %s", version.Name, version.V, lol.GetLevel(),
)
}