From 462ca98bd6751ab91a8967a99f98f9553c48e7fd Mon Sep 17 00:00:00 2001 From: demo Date: Sat, 30 May 2026 23:04:48 -0400 Subject: feat: upgrade hamlet and use newer stuff from there --- main.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'main.go') diff --git a/main.go b/main.go index 28c2d0d..db41eab 100644 --- a/main.go +++ b/main.go @@ -46,13 +46,15 @@ func main() { log.Fatalf("Invalid -depth argument: %d", *maxDepth) } - shortcodePresent := hamlet.New(*shortcode) - urlArgPresent := hamlet.New(*urlArg) - if hamlet.Iff(urlArgPresent, shortcodePresent).Assert() { + // Use hamlet to vet the validity of the given command-line + // argument configuration provided by the user. + shortcodePresent := hamlet.Present(*shortcode) + urlArgPresent := hamlet.Present(*urlArg) + if hamlet.Xor(urlArgPresent, shortcodePresent).Deny() { log.Fatal("Need exactly one of -url or -shortcode") } - if !hamlet.If(hamlet.New(*shortcodeFilename), shortcodePresent).Assert() { + if hamlet.If(hamlet.Present(*shortcodeFilename), shortcodePresent).Deny() { log.Fatal("-scfile implies use of -shortcode") } -- cgit v1.2.3