From 233e40bc69b4fecf0742222e4b6111f730db5e2c Mon Sep 17 00:00:00 2001 From: Chloe Kudryavtsev Date: Sun, 19 Apr 2020 19:12:34 -0400 Subject: Bump to libuconf rewrite --- main.go | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'main.go') 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 -- cgit v1.2.3