diff options
author | Benny Morrison <benmorrison@ttm.sh> | 2019-03-18 20:18:09 -0400 |
---|---|---|
committer | Benny Morrison <benmorrison@ttm.sh> | 2019-03-18 20:18:09 -0400 |
commit | 9c149f6d9edead1410412d49171351ed279cb9ff (patch) | |
tree | c9e898a48b1dd52f44929fc494ca34da650760e1 /main.go | |
parent | beda97b1efdb8dc09e820b94d5cdc6a461a6d769 (diff) | |
download | goofbot-9c149f6d9edead1410412d49171351ed279cb9ff.tar.gz |
extended command line flags now available
Diffstat (limited to 'main.go')
-rw-r--r-- | main.go | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/main.go b/main.go index 5c98787..5e06226 100644 --- a/main.go +++ b/main.go @@ -42,11 +42,13 @@ type Conf struct { func main() { //check for config file specified by command line flag -c jsonlocation := flag.String("c", "config.json", "Path to config file in JSON format") + jsonlocationlong := flag.String("config", "config.json", "Same as -c") //spit out config file structure if requested jsonformat := flag.Bool("j", false, "Describes JSON config file fields") + jsonformatlong := flag.Bool("json", false, "Same as -j") flag.Parse() - if *jsonformat == true { + if *jsonformat == true || *jsonformatlong == true { fmt.Println(`Here is the format for the JSON config file: { "owner": "YourNickHere", @@ -62,6 +64,9 @@ func main() { os.Exit(0) } //read the config file into a byte array + if *jsonlocationlong != "config.json" && *jsonlocationlong != "" { + *jsonlocation = *jsonlocationlong + } jsonconf, err := ioutil.ReadFile(*jsonlocation) checkerr(err) |