mirror of
https://github.com/prymitive/karma
synced 2026-05-05 03:16:51 +00:00
@@ -79,8 +79,6 @@ func init() {
|
||||
func (config *configSchema) Read() {
|
||||
v := viper.New()
|
||||
|
||||
pflag.Parse()
|
||||
|
||||
pflag.CommandLine.AddGoFlagSet(flag.CommandLine)
|
||||
pflag.Parse()
|
||||
v.BindPFlags(pflag.CommandLine)
|
||||
|
||||
8
main.go
8
main.go
@@ -12,6 +12,7 @@ import (
|
||||
"github.com/cloudflare/unsee/internal/config"
|
||||
"github.com/cloudflare/unsee/internal/models"
|
||||
"github.com/cloudflare/unsee/internal/transform"
|
||||
"github.com/spf13/pflag"
|
||||
|
||||
"github.com/DeanThompson/ginpprof"
|
||||
"github.com/gin-contrib/gzip"
|
||||
@@ -109,6 +110,13 @@ func setupLogger() {
|
||||
}
|
||||
|
||||
func main() {
|
||||
printVersion := pflag.Bool("version", false, "Print version and exit")
|
||||
pflag.Parse()
|
||||
if *printVersion {
|
||||
fmt.Println(version)
|
||||
return
|
||||
}
|
||||
|
||||
config.Config.Read()
|
||||
setupLogger()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user