This commit is contained in:
Bel LaPointe
2024-12-14 20:46:17 -07:00
parent aa330dffea
commit 2b958fafe9

View File

@@ -11,6 +11,10 @@ import (
type Config struct {
Port int
Root string
DB struct {
Scheme string
Conn string
}
}
func NewConfig() (Config, error) {
@@ -19,6 +23,8 @@ func NewConfig() (Config, error) {
fs.IntVar(&c.Port, "p", 8080, "port")
fs.StringVar(&c.Root, "r", "/tmp/", "static file root")
fs.StringVar(&c.DB.Scheme, "db-scheme", "sqlite", "sql scheme")
fs.StringVar(&c.DB.Conn, "db-conn", "/tmp/out.sql", "sql conn string")
err := fs.Parse(os.Args[1:])
return c, err