diff --git a/main.go b/main.go index e3fd6c5..8c01b67 100644 --- a/main.go +++ b/main.go @@ -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() { @@ -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()