zitadel/cmd/start/flags.go
Tim Möhlmann 25ef3da9d5
refactor(fmt): run gci on complete project (#7557)
chore(fmt): run gci on complete project

Fix global import formatting in go code by running the `gci` command. This allows us to just use the command directly, instead of fixing the import order manually for the linter, on each PR.

Co-authored-by: Elio Bischof <elio@zitadel.com>
2024-04-03 10:43:43 +00:00

32 lines
692 B
Go

package start
import (
"github.com/spf13/cobra"
"github.com/spf13/pflag"
"github.com/spf13/viper"
"github.com/zitadel/logging"
"github.com/zitadel/zitadel/cmd/key"
"github.com/zitadel/zitadel/cmd/tls"
)
var (
startFlagSet = &pflag.FlagSet{}
)
func init() {
startFlagSet.Uint16("port", 0, "port to run ZITADEL on")
startFlagSet.String("externalDomain", "", "domain ZITADEL will be exposed on")
startFlagSet.String("externalPort", "", "port ZITADEL will be exposed on")
}
func startFlags(cmd *cobra.Command) {
cmd.Flags().AddFlagSet(startFlagSet)
logging.OnError(
viper.BindPFlags(startFlagSet),
).Fatal("start flags")
tls.AddTLSModeFlag(cmd)
key.AddMasterKeyFlag(cmd)
}