aboutsummaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'main.go')
-rw-r--r--main.go15
1 files changed, 5 insertions, 10 deletions
diff --git a/main.go b/main.go
index 85ee6cc..3b5ccba 100644
--- a/main.go
+++ b/main.go
@@ -2,6 +2,7 @@ package main
import (
"errors"
+ "flag"
"fmt"
"log"
"net/http"
@@ -26,18 +27,12 @@ func errExit(err error) {
}
func main() {
- opts, _, err := util.Getopts(os.Args, "f:")
- if err != nil {
- errExit(err)
- }
+ configFile := flag.String("f", "", "config file")
+ flag.Parse()
- for _, opt := range opts {
- switch opt.Option {
- case 'f':
- configFiles = []string{opt.Value}
- }
+ if len(*configFile) > 0 {
+ configFiles = []string{*configFile}
}
-
config, err := config.ParseFiles(configFiles)
if err != nil {
errExit(err)