From 4bfdee0e074223a212117bff0ab3caa8bc95b694 Mon Sep 17 00:00:00 2001 From: Yoshiki Takagi Date: Sun, 7 May 2023 02:57:36 +0900 Subject: [PATCH] Print a helpful suggestion for wrong argument --- main.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/main.go b/main.go index a3a6c17..e2a8111 100644 --- a/main.go +++ b/main.go @@ -11,6 +11,7 @@ import ( "github.com/cli/go-gh/pkg/term" "io" "log" + "os" "strconv" ) @@ -284,5 +285,13 @@ func main() { flag.BoolVar(&options.json, "json", false, "Output JSON") flag.Parse() + arg := flag.Arg(0) + + if arg != "" { + fmt.Println("Did you mean this?") + fmt.Printf("\tgh annotations -repo %s\n", arg) + os.Exit(1) + } + run(options) }