summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordemo <demo@antix1>2026-05-28 17:32:07 -0400
committerdemo <demo@antix1>2026-05-28 17:32:07 -0400
commit73f0ff9f11ff5f75a92adc5cd59f87b6fb019150 (patch)
treeec99021bdb7cd2388606227f2cb0cc69960b6142
parent848481fd1a738225664fa398275fcd1afd61c4ff (diff)
feat: specify whether URL sources are both missing or both present
-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 {