Skip to content

Commit

Permalink
update flag.Usage before parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
nabeken committed Aug 8, 2020
1 parent 9bbdca7 commit 68b3c5f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ func main() {
appID := flag.Int64("app-id", 0, "App ID")
instID := flag.Int64("inst-id", 0, "Installation ID")
export := flag.Bool("export", false, "show token as 'export GITHUB_TOKEN=...'")
flag.Parse()

origUsage := flag.Usage
flag.Usage = func() {
Expand All @@ -36,6 +35,8 @@ func main() {
versionInfo()
}

flag.Parse()

if *appID == 0 || *instID == 0 {
fmt.Fprintf(os.Stderr, "App ID and Installation ID are required.\n\n")
flag.Usage()
Expand Down

0 comments on commit 68b3c5f

Please sign in to comment.