@ -12,7 +12,7 @@ func main() {
authCmd := cmd.NewAuthCmd()
authCmd.AddPortFlag()
authCmd.AddPrometheusPortFlag()
if err := authCmd.Execute(); err != nil {
if err := authCmd.Exec(); err != nil {
fmt.Println(err.Error())
os.Exit(1)
}
@ -17,9 +17,10 @@ func NewAuthCmd() *AuthCmd {
func (a *AuthCmd) Exec() error {
a.Command.Run = func(cmd *cobra.Command, args []string) {
a.Command.RunE = func(cmd *cobra.Command, args []string) error {
a.port = a.getPortFlag(cmd)
a.prometheusPort = a.getPrometheusPortFlag(cmd)
return a.getConfFromCmdAndInit(cmd)
return a.Execute()