Skip to content

Commit 3282064

Browse files
committed
Update
1 parent b6a0f6f commit 3282064

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ git-synchronizer --help
1616

1717
## Configuration file
1818

19-
If you'd like to set the above options in a configuration file, by default `git-synchronizer` checks `~/.git-synchronizer`, `~/.git-synchronizer.yaml` and `~/.git-synchronizer.yml` files.
19+
If you'd like to set the options in a configuration file, by default `git-synchronizer` checks `~/.git-synchronizer`, `~/.git-synchronizer.yaml` and `~/.git-synchronizer.yml` files.
2020
If any of these files exist, `git-synchronizer` uses options defined there, unless they are overridden by command line flags.
2121

2222
You can also specify custom path to configuration file with `--config <your-configuration-file>.yml` command line flag.
@@ -39,6 +39,8 @@ The order of precedence is:
3939

4040
CLI flag → environment variable → configuration file → default value.
4141

42+
To check the available names of environment variables, please run `git-synchronizer --help`.
43+
4244
## Development
4345

4446
This project is built with the [Go programming language](https://go.dev/).

cmd/root.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ func setLogLevel() {
3939
log.SetFormatter(customFormatter)
4040
log.SetReportCaller(true)
4141
customFormatter.FullTimestamp = true
42-
fmt.Println("logLevel =", logLevel)
42+
fmt.Println(`logLevel = "` + logLevel + `"`)
4343
switch logLevel {
4444
case "trace":
4545
log.SetLevel(logrus.TraceLevel)
@@ -71,8 +71,8 @@ repositories.`,
7171
Run: func(cmd *cobra.Command, args []string) {
7272
setLogLevel()
7373

74-
fmt.Println("config =", cfgFile)
75-
fmt.Println("exampleParameter =", exampleParameter)
74+
fmt.Println(`config = "` + cfgFile + `"`)
75+
fmt.Println(`exampleParameter = "` + exampleParameter + `"`)
7676
},
7777
}
7878
rootCmd.PersistentFlags().StringVar(&cfgFile, "config", "",
@@ -105,7 +105,7 @@ func initConfig() {
105105
home, err := os.UserHomeDir()
106106
cobra.CheckErr(err)
107107

108-
// Search config in home directory with name ".git-synchronizer" (without extension).
108+
// Search for config in home directory.
109109
viper.AddConfigPath(home)
110110
viper.SetConfigType("yaml")
111111
viper.SetConfigName(".git-synchronizer")

0 commit comments

Comments
 (0)