aboutsummaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
authorJonathan DeMasi <jrdemasi@gmail.com>2019-06-06 23:57:00 -0600
committerJonathan DeMasi <jrdemasi@gmail.com>2019-06-06 23:57:00 -0600
commita8bccea089c9bfb71e4f168b1341227d47f51d8f (patch)
tree580140d92e82bf85323884e788c7a7b7de9bcd6a /main.go
parent7019056f536cdae0a38c2fe8e2d6930e8baf4936 (diff)
downloadgh_authkey_checker-a8bccea089c9bfb71e4f168b1341227d47f51d8f.tar
gh_authkey_checker-a8bccea089c9bfb71e4f168b1341227d47f51d8f.tar.gz
gh_authkey_checker-a8bccea089c9bfb71e4f168b1341227d47f51d8f.tar.bz2
gh_authkey_checker-a8bccea089c9bfb71e4f168b1341227d47f51d8f.tar.lz
gh_authkey_checker-a8bccea089c9bfb71e4f168b1341227d47f51d8f.tar.xz
gh_authkey_checker-a8bccea089c9bfb71e4f168b1341227d47f51d8f.tar.zst
gh_authkey_checker-a8bccea089c9bfb71e4f168b1341227d47f51d8f.zip
cleaned up arg parsing
Diffstat (limited to 'main.go')
-rw-r--r--main.go16
1 files changed, 5 insertions, 11 deletions
diff --git a/main.go b/main.go
index a0f75bb..18969d0 100644
--- a/main.go
+++ b/main.go
@@ -9,18 +9,12 @@ import (
)
func parseArgs() string {
- // Check for at least one arg, bail if none
- if len(os.Args) < 2 {
- log.Fatalln("You must provide exactly one GitHub username.")
+ // We can only accept one argument
+ if len(os.Args) != 2 {
+ fmt.Println("Usage: gh_authkey_checker <username>")
+ os.Exit(1)
}
-
- // We have one arg possible comma separated
- if len(os.Args) == 2 {
- return os.Args[1]
- } else {
- log.Fatalln("You have provided too many arguments")
- }
- return ""
+ return os.Args[1]
}
func fetchKeys(username string) string {