fix(cmd): support alternative config paths
This commit is contained in:
parent
7f5782cde5
commit
a103950b96
6
main.go
6
main.go
@ -1,6 +1,7 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"flag"
|
||||
"os"
|
||||
|
||||
log "github.com/sirupsen/logrus"
|
||||
@ -11,6 +12,7 @@ import (
|
||||
|
||||
var (
|
||||
version string
|
||||
configPath string
|
||||
)
|
||||
|
||||
func main() {
|
||||
@ -41,9 +43,11 @@ func main() {
|
||||
})
|
||||
}
|
||||
|
||||
flag.StringVar(&configPath, "config", "/etc/dyndns-client/config.json", "Path to json config")
|
||||
|
||||
log.Infof("version %v", version)
|
||||
|
||||
cnf, err := config.Read("/etc/dyndns-client/config.json")
|
||||
cnf, err := config.Read(configPath)
|
||||
if err != nil {
|
||||
log.Fatal(err.Error())
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user