summaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'main.go')
-rw-r--r--main.go10
1 files changed, 6 insertions, 4 deletions
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")
}