mirror of
https://github.com/pomerium/pomerium.git
synced 2025-07-19 01:28:51 +02:00
bug: version should be processed before other flags (#99)
This commit is contained in:
parent
4bdb9173ff
commit
1a3add8fbc
1 changed files with 5 additions and 5 deletions
|
@ -26,21 +26,21 @@ var (
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
flag.Parse()
|
||||||
|
if *versionFlag {
|
||||||
|
fmt.Printf("%s\n", version.FullVersion())
|
||||||
|
os.Exit(0)
|
||||||
|
}
|
||||||
mainOpts, err := optionsFromEnvConfig()
|
mainOpts, err := optionsFromEnvConfig()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal().Err(err).Msg("cmd/pomerium: settings error")
|
log.Fatal().Err(err).Msg("cmd/pomerium: settings error")
|
||||||
}
|
}
|
||||||
flag.Parse()
|
|
||||||
if *debugFlag || mainOpts.Debug {
|
if *debugFlag || mainOpts.Debug {
|
||||||
log.SetDebugMode()
|
log.SetDebugMode()
|
||||||
}
|
}
|
||||||
if mainOpts.LogLevel != "" {
|
if mainOpts.LogLevel != "" {
|
||||||
log.SetLevel(mainOpts.LogLevel)
|
log.SetLevel(mainOpts.LogLevel)
|
||||||
}
|
}
|
||||||
if *versionFlag {
|
|
||||||
fmt.Printf("%s", version.FullVersion())
|
|
||||||
os.Exit(0)
|
|
||||||
}
|
|
||||||
log.Info().Str("version", version.FullVersion()).Str("user-agent", version.UserAgent()).Str("service", mainOpts.Services).Msg("cmd/pomerium")
|
log.Info().Str("version", version.FullVersion()).Str("user-agent", version.UserAgent()).Str("service", mainOpts.Services).Msg("cmd/pomerium")
|
||||||
|
|
||||||
grpcAuth := middleware.NewSharedSecretCred(mainOpts.SharedKey)
|
grpcAuth := middleware.NewSharedSecretCred(mainOpts.SharedKey)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue