summaryrefslogtreecommitdiffhomepage
path: root/main.go
diff options
context:
space:
mode:
authorChloe Kudryavtsev <toast@toast.cafe>2020-04-19 19:12:34 -0400
committerChloe Kudryavtsev <toast@toast.cafe>2020-04-19 19:12:34 -0400
commit233e40bc69b4fecf0742222e4b6111f730db5e2c (patch)
tree4c1e810b3e567188a751379a19ccb20e23d145ce /main.go
parentci: static builds only pls (diff)
Bump to libuconf rewrite
Diffstat (limited to 'main.go')
-rw-r--r--main.go11
1 files changed, 6 insertions, 5 deletions
diff --git a/main.go b/main.go
index 3e983ab..69a3772 100644
--- a/main.go
+++ b/main.go
@@ -21,11 +21,12 @@ type settings struct {
func main() {
// ---- Flags
- flag := libuconf.DefaultSet
- flag.StringVar(&s.Bind, "bind", ":8080", "address to bind to")
- flag.StringVar(&s.Redis, "redis", "redis://localhost:6379", "redis connection string")
- flag.StringVar(&s.Storage, "storage", "redis", "type of storage to use")
- flag.Parse()
+ ops := &libuconf.OptionSet{AppName: "brpaste"}
+ ops.StringVar(&s.Bind, "bind", ":8080", "address to bind to")
+ ops.StringVar(&s.Redis, "redis", "redis://localhost:6379", "redis connection string")
+ ops.StringVar(&s.Storage, "storage", "redis", "type of storage to use")
+ ops.ParseEnv()
+ ops.ParseFlags(os.Args[1:])
// ---- Storage system
var store storage.CHR