From 7ccff335363d1a8b0e66466183d3a0fe54eeeba8 Mon Sep 17 00:00:00 2001 From: Ace Eldeib Date: Tue, 21 Apr 2020 14:25:53 -0700 Subject: [PATCH] fix: be more helpful on bad args (#1) --- main.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/main.go b/main.go index 821e718..03e7d10 100644 --- a/main.go +++ b/main.go @@ -39,6 +39,12 @@ func newRootCmd() *cobra.Command { if len(args) < 1 || len(args) > 2 { return fmt.Errorf("accepts 1 or 2 args, received %d", len(args)) } + if args[0] == "" { + return fmt.Errorf("oldCommit should not be empty") + } + if len(args) == 2 && args[1] == "" { + return fmt.Errorf("if provided, newCommit should not be empty") + } return nil }