Skip to content

Commit

Permalink
Fix getting params from environment variables (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
dwaiting authored and satterly committed Jun 29, 2019
1 parent 98f1a4b commit 3baa740
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,17 +61,15 @@ func configureRootCommand() *cobra.Command {
cmd.Flags().StringVarP(&config.AlertaEndpoint.Value,
"endpoint-url",
"",
os.Getenv("ALERTA_ENDPOINT"),
os.Getenv(config.AlertaEndpoint.Env),
"API endpoint URL.")

cmd.Flags().StringVarP(&config.AlertaApiKey.Value,
"api-key",
"K",
os.Getenv("ALERTA_API_KEY"),
os.Getenv(config.AlertaApiKey.Env),
"API key for authenticated access.")

_ = cmd.MarkFlagRequired("endpoint-url")

return cmd
}

Expand Down

0 comments on commit 3baa740

Please sign in to comment.