Skip to content

Commit

Permalink
Merge pull request #843 from Kellel/kellel/831-fix
Browse files Browse the repository at this point in the history
Fixes #831
  • Loading branch information
fabxc authored Jun 6, 2017
2 parents ffe79ad + 305263e commit 3100147
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions cli/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,13 @@ var RootCmd = &cobra.Command{
[Config File]
The alertmanager tool will read a config file from the --config cli argument, AMTOOL_CONFIG environment variable,
$HOME/.amtool.yml or /etc/amtool.yml the options are as follows
The alertmanager tool will read a config file from the --config cli argument, AMTOOL_CONFIG environment variable or
from one of two default config locations. Valid config file formats are JSON, TOML, YAML, HCL and Java Properties, use
whatever makes sense for your project.
The default config file paths are $HOME/.config/amtool/config.yml or /etc/amtool/config.yml
The accepted config options are as follows:
alertmanager.url
Set a default alertmanager url for each request
Expand Down Expand Up @@ -58,9 +63,9 @@ func init() {

// initConfig reads in config file and ENV variables if set.
func initConfig() {
viper.SetConfigName(".amtool") // name of config file (without extension)
viper.AddConfigPath("/etc")
viper.AddConfigPath("$HOME")
viper.SetConfigName("config") // name of config file (without extension)
viper.AddConfigPath("/etc/amtool")
viper.AddConfigPath("$HOME/.config/amtool")
viper.SetEnvPrefix("AMTOOL")
viper.AutomaticEnv() // read in environment variables that match

Expand Down

0 comments on commit 3100147

Please sign in to comment.