Skip to content

Commit

Permalink
Read cli options from env variables (#171)
Browse files Browse the repository at this point in the history
Signed-off-by: Evans Mungai <[email protected]>
  • Loading branch information
banjoh authored Jul 31, 2024
1 parent 357bc5b commit 2e7fa14
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions cli/serve.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ func ServeCmd() *cobra.Command {
SilenceUsage: true,
SilenceErrors: false,
PreRunE: func(cmd *cobra.Command, args []string) error {
viper.SetEnvPrefix("sbctl")
return viper.BindPFlags(cmd.Flags())
},
RunE: func(cmd *cobra.Command, args []string) error {
Expand Down
1 change: 1 addition & 0 deletions cli/shell.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ func ShellCmd() *cobra.Command {
SilenceUsage: true,
SilenceErrors: false,
PreRunE: func(cmd *cobra.Command, args []string) error {
viper.SetEnvPrefix("sbctl")
return viper.BindPFlags(cmd.Flags())
},
RunE: func(cmd *cobra.Command, args []string) error {
Expand Down

0 comments on commit 2e7fa14

Please sign in to comment.