about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAlan Pearce2024-06-09 12:23:52 +0200
committerAlan Pearce2024-06-09 12:23:52 +0200
commita495a673d2dda7b2aa9b11217d4662367a627517 (patch)
tree64986c5957ab6e174f724b8f599cd136903c64a4
parente6651469b9e934cb4dc65f760277111a79e9ae2d (diff)
downloadsearchix-a495a673d2dda7b2aa9b11217d4662367a627517.tar.lz
searchix-a495a673d2dda7b2aa9b11217d4662367a627517.tar.zst
searchix-a495a673d2dda7b2aa9b11217d4662367a627517.zip
feat: enable configuration of flags as environment variables
-rw-r--r--cmd/searchix-web/main.go4
-rw-r--r--go.mod2
-rw-r--r--go.sum6
-rw-r--r--gomod2nix.toml6
4 files changed, 15 insertions, 3 deletions
diff --git a/cmd/searchix-web/main.go b/cmd/searchix-web/main.go
index 1eef5c3..c9ba2d6 100644
--- a/cmd/searchix-web/main.go
+++ b/cmd/searchix-web/main.go
@@ -9,6 +9,8 @@ import (
 	"os"
 	"os/signal"
 
+	"badc0de.net/pkg/flagutil"
+
 	"searchix"
 	"searchix/internal/config"
 )
@@ -27,7 +29,7 @@ var (
 )
 
 func main() {
-	flag.Parse()
+	flagutil.Parse()
 	if *version {
 		_, err := fmt.Fprintf(os.Stderr, "searchix %s\n", config.Version)
 		if err != nil {
diff --git a/go.mod b/go.mod
index e1bbf02..dfe5633 100644
--- a/go.mod
+++ b/go.mod
@@ -3,6 +3,7 @@ module searchix
 go 1.22.2
 
 require (
+	badc0de.net/pkg/flagutil v1.0.1
 	github.com/andybalholm/brotli v1.1.0
 	github.com/bcicen/jstream v1.0.1
 	github.com/blevesearch/bleve/v2 v2.4.0
@@ -48,6 +49,7 @@ require (
 	github.com/modern-go/reflect2 v1.0.2 // indirect
 	github.com/mschoch/smat v0.2.0 // indirect
 	go.etcd.io/bbolt v1.3.10 // indirect
+	golang.org/x/sync v0.6.0 // indirect
 	golang.org/x/sys v0.20.0 // indirect
 	golang.org/x/text v0.15.0 // indirect
 	google.golang.org/protobuf v1.34.1 // indirect
diff --git a/go.sum b/go.sum
index fe5d683..12bc46f 100644
--- a/go.sum
+++ b/go.sum
@@ -1,3 +1,5 @@
+badc0de.net/pkg/flagutil v1.0.1 h1:0ZgBzd3FehDUA8DJ70/phsnDH61/3aYMyx8Wd84KqQo=
+badc0de.net/pkg/flagutil v1.0.1/go.mod h1:HwwkfbImu+u288bnLaYDGqBxkJzvqi5YzKofmgkMLvk=
 github.com/RoaringBitmap/roaring v1.9.3 h1:t4EbC5qQwnisr5PrP9nt0IRhRTb9gMUgQF4t4S2OByM=
 github.com/RoaringBitmap/roaring v1.9.3/go.mod h1:6AXUsoIEzDTFFQCe1RbGA6uFONMhvejWj5rqITANK90=
 github.com/andybalholm/brotli v1.1.0 h1:eLKJA0d02Lf0mVpIDgYnqXcUn0GqVmEFny3VuID1U3M=
@@ -107,8 +109,8 @@ go.etcd.io/bbolt v1.3.10 h1:+BqfJTcCzTItrop8mq/lbzL8wSGtj94UO/3U31shqG0=
 go.etcd.io/bbolt v1.3.10/go.mod h1:bK3UQLPJZly7IlNmV7uVHJDxfe5aK9Ll93e/74Y9oEQ=
 golang.org/x/net v0.25.0 h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac=
 golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM=
-golang.org/x/sync v0.5.0 h1:60k92dhOjHxJkrqnwsfl8KuaHbn/5dl0lUPUklKo3qE=
-golang.org/x/sync v0.5.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
+golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ=
+golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
 golang.org/x/sys v0.0.0-20210908233432-aa78b53d3365/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
 golang.org/x/sys v0.0.0-20220111092808-5a964db01320/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
 golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
diff --git a/gomod2nix.toml b/gomod2nix.toml
index b62797b..d11ffe2 100644
--- a/gomod2nix.toml
+++ b/gomod2nix.toml
@@ -1,6 +1,9 @@
 schema = 3
 
 [mod]
+  [mod."badc0de.net/pkg/flagutil"]
+    version = "v1.0.1"
+    hash = "sha256-0LRWL5DUHW3gXQhPAhUCxnUCN7HN1qKI2yZp8MrDN6M="
   [mod."github.com/RoaringBitmap/roaring"]
     version = "v1.9.3"
     hash = "sha256-LZfRufkU4UhuEcgxuCPd6divX2KIdcHp1FOt79mQV7Q="
@@ -127,6 +130,9 @@ schema = 3
   [mod."golang.org/x/net"]
     version = "v0.25.0"
     hash = "sha256-IjFfXLYNj27WLF7vpkZ6mfFXBnp+7QER3OQ0RgjxN54="
+  [mod."golang.org/x/sync"]
+    version = "v0.6.0"
+    hash = "sha256-LLims/wjDZtIqlYCVHREewcUOX4hwRwplEuZKPOJ/HI="
   [mod."golang.org/x/sys"]
     version = "v0.20.0"
     hash = "sha256-mowlaoG2k4n1c1rApWef5EMiXd3I77CsUi8jPh6pTYA="