mirror of
https://github.com/Sean-Der/fail2rest.git
synced 2024-12-22 05:32:20 +01:00
config.json path can now be specified with the --config flag
This commit is contained in:
parent
a49b9b67de
commit
f3fe29f69b
1 changed files with 5 additions and 1 deletions
|
@ -2,6 +2,7 @@ package main
|
|||
|
||||
import (
|
||||
"encoding/json"
|
||||
"flag"
|
||||
"fmt"
|
||||
"github.com/Sean-Der/fail2go"
|
||||
"github.com/gorilla/mux"
|
||||
|
@ -21,7 +22,10 @@ type ErrorBody struct {
|
|||
var fail2goConn *fail2go.Conn
|
||||
|
||||
func main() {
|
||||
file, fileErr := os.Open("config.json")
|
||||
configPath := flag.String("config", "config.json", "path to config.json")
|
||||
flag.Parse()
|
||||
|
||||
file, fileErr := os.Open(*configPath)
|
||||
|
||||
if fileErr != nil {
|
||||
fmt.Println("failed to open config:", fileErr)
|
||||
|
|
Loading…
Reference in a new issue