From 73f0ff9f11ff5f75a92adc5cd59f87b6fb019150 Mon Sep 17 00:00:00 2001 From: demo Date: Thu, 28 May 2026 17:32:07 -0400 Subject: feat: specify whether URL sources are both missing or both present --- main.go | 9 +++++++-- 1 file 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 { -- cgit v1.2.3