diff options
| -rw-r--r-- | go.mod | 2 | ||||
| -rw-r--r-- | go.sum | 2 | ||||
| -rw-r--r-- | main.go | 10 |
3 files changed, 9 insertions, 5 deletions
@@ -4,4 +4,4 @@ go 1.26.2 require golang.org/x/net v0.54.0 -require git.brandonirizarry.xyz/hamlet v0.1.1 // indirect +require git.brandonirizarry.xyz/hamlet v0.1.2 // indirect @@ -1,4 +1,6 @@ git.brandonirizarry.xyz/hamlet v0.1.1 h1:jf6Jh82bzVA9p/7GbO10uX7r+6B19QrDA7mkv+Gi+5s= git.brandonirizarry.xyz/hamlet v0.1.1/go.mod h1:J+v/AHboHRz0Tp04nRODRacbmyk6V+f1w2EwA3HQ1Og= +git.brandonirizarry.xyz/hamlet v0.1.2 h1:yKzEAelhDkN9R098HVY26xVHmrpqqvgFnY9tvlLl814= +git.brandonirizarry.xyz/hamlet v0.1.2/go.mod h1:J+v/AHboHRz0Tp04nRODRacbmyk6V+f1w2EwA3HQ1Og= golang.org/x/net v0.54.0 h1:2zJIZAxAHV/OHCDTCOHAYehQzLfSXuf/5SoL/Dv6w/w= golang.org/x/net v0.54.0/go.mod h1:Sj4oj8jK6XmHpBZU/zWHw3BV3abl4Kvi+Ut7cQcY+cQ= @@ -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") } |
