summaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'main.go')
-rw-r--r--main.go9
1 files changed, 7 insertions, 2 deletions
diff --git a/main.go b/main.go
index ec7e6b2..c6eec0b 100644
--- a/main.go
+++ b/main.go
@@ -2,6 +2,7 @@ package main
import (
"bufio"
+ "flag"
"fmt"
"os"
@@ -9,9 +10,13 @@ import (
)
func main() {
- f, err := os.Open("stasher.cfg")
+ var configpath *string
+ configpath = flag.String("c", "stasher.cfg", "Path to config file")
+ flag.Parse()
+
+ f, err := os.Open(*configpath)
if err != nil {
- fmt.Fprintf(os.Stderr, "Could not open config file 'stasher.cfg': %q\n", err)
+ fmt.Fprintf(os.Stderr, "Could not open config file %q: %q\n", *configpath, err)
os.Exit(1)
}