diff options
| -rw-r--r-- | main.go | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -3,7 +3,6 @@ package main import ( - "errors" "flag" "fmt" "log" @@ -70,7 +69,13 @@ func chooseFrom(urlArg, shortcode, shortcodeFilename string) (string, error) { shortcodeAbsent := (shortcode == "") if urlAbsent == shortcodeAbsent { - return "", errors.New("-url and -shortcode flags either both missing or both present") + messageSlug := "present" + + if urlAbsent { + messageSlug = "missing; need exactly one" + } + + return "", fmt.Errorf("-url and -shortcode flags both %s", messageSlug) } if urlAbsent { |
