1
1
Fork 0
mirror of https://git.sr.ht/~emersion/tlstunnel synced 2024-05-12 06:26:23 +02:00

Add -config flag

This commit is contained in:
Simon Ser 2020-09-09 14:17:27 +02:00
parent 9aefd1937d
commit f64eb89cee
No known key found for this signature in database
GPG Key ID: 0FDE7BE0E88F5E48

View File

@ -1,6 +1,7 @@
package main
import (
"flag"
"fmt"
"log"
"net"
@ -8,8 +9,13 @@ import (
"strings"
)
var configPath = "config"
func main() {
cfg, err := Load("config")
flag.StringVar(&configPath, "config", configPath, "path to configuration file")
flag.Parse()
cfg, err := Load(configPath)
if err != nil {
log.Fatalf("failed to load config file: %v", err)
}