Skip to content

Commit

Permalink
chore: Add a env prefix (#200)
Browse files Browse the repository at this point in the history
  • Loading branch information
kukugi authored May 18, 2021
1 parent 23a0f9e commit 623dd8c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion server/cmd/execute.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ import (
"github.com/line/lbm-sdk/v2/server"
)

const (
envPrefix = "LBM"
)

// Execute executes the root command of an application. It handles creating a
// server context object with the appropriate server and client objects injected
// into the underlying stdlib Context. It also handles adding core CLI flags,
Expand All @@ -32,6 +36,6 @@ func Execute(rootCmd *cobra.Command, defaultHome string) error {
rootCmd.PersistentFlags().String(flags.FlagLogLevel, zerolog.InfoLevel.String(), "The logging level (trace|debug|info|warn|error|fatal|panic)")
rootCmd.PersistentFlags().String(flags.FlagLogFormat, ostcfg.LogFormatPlain, "The logging format (json|plain)")

executor := ostcli.PrepareBaseCmd(rootCmd, "", defaultHome)
executor := ostcli.PrepareBaseCmd(rootCmd, envPrefix, defaultHome)
return executor.ExecuteContext(ctx)
}

0 comments on commit 623dd8c

Please sign in to comment.