Skip to content

Commit

Permalink
CLI flags fix
Browse files Browse the repository at this point in the history
  • Loading branch information
UtkarshVerma committed Apr 19, 2020
1 parent 01e723b commit 2521799
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions cli/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package cli

import (
"flag"
"log"
"os"
)

Expand All @@ -24,13 +23,13 @@ func init() {
CredsFile = InitCmd.String("creds", "~/.config/qgmail/credentials.json", "Path to Google API client credentials.")
TokenFile = InitCmd.String("token", "~/.config/qgmail/token.json", "Path for storing the authorization token.")
InitCmd.Parse(os.Args[2:])
default:
log.Fatal("Invalid argument passed. Run 'qgmail --help` for valid options.")
}

// To future self: add default case.
}
flag.Parse()
if InitMode = InitCmd.Parsed(); InitMode {
if InitMode = InitCmd.Parsed(); !InitMode {
CredsFile = flag.String("creds", "~/.config/qgmail/credentials.json", "Path to Google API client credentials.")
TokenFile = flag.String("token", "~/.config/qgmail/token.json", "Path for storing the authorization token.")
}
flag.Parse()
}

0 comments on commit 2521799

Please # to comment.