summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--main.go9
1 files changed, 7 insertions, 2 deletions
diff --git a/main.go b/main.go
index b48f6c9..565a2c9 100644
--- a/main.go
+++ b/main.go
@@ -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 {