From 8ce353bf1b101f71475cec21ccec579ffb09eab8 Mon Sep 17 00:00:00 2001 From: Nikhil Anand Date: Tue, 25 Apr 2023 19:27:42 -0500 Subject: [PATCH] Sanity check for CLI args --- VERSION | 2 +- constants.go | 1 + main.go | 4 ++++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 4395fc0..c1f1353 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -5.0.0-beta.01 +5.1.0-beta diff --git a/constants.go b/constants.go index bfe2338..37acdb2 100644 --- a/constants.go +++ b/constants.go @@ -31,6 +31,7 @@ const ( EXIT_COULD_NOT_GENERATE_LIST_OF_ENTITIES EXIT_COULD_NOT_WRITE_ENTITY_TREE EXIT_COULD_NOT_CREATE_OUTPUT_FOLDER + EXIT_INVALID_FLAG_SUPPLIED ) // Things to ignore when walking the article repository. NOTE: In Golang, only diff --git a/main.go b/main.go index 9b7f180..afe0b02 100644 --- a/main.go +++ b/main.go @@ -101,6 +101,10 @@ func main() { fmt.Println(help) os.Exit(0) + default: + fmt.Println("I don't know what this means:", arg) + fmt.Println("Use --help to see usage.") + os.Exit(EXIT_INVALID_FLAG_SUPPLIED) } }