aboutsummaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'main.go')
-rw-r--r--main.go19
1 files changed, 18 insertions, 1 deletions
diff --git a/main.go b/main.go
index e29f53a..423d06a 100644
--- a/main.go
+++ b/main.go
@@ -14,6 +14,11 @@ import (
"web/renderer"
"web/repository"
"web/service"
+ "web/util"
+)
+
+var (
+ configFile = "bloat.conf"
)
func init() {
@@ -21,7 +26,19 @@ func init() {
}
func main() {
- config, err := config.ParseFile("default.conf")
+ opts, _, err := util.Getopts(os.Args, "f:")
+ if err != nil {
+ log.Fatal(err)
+ }
+
+ for _, opt := range opts {
+ switch opt.Option {
+ case 'f':
+ configFile = opt.Value
+ }
+ }
+
+ config, err := config.ParseFile(configFile)
if err != nil {
log.Fatal(err)
}