diff options
Diffstat (limited to 'main.go')
| -rw-r--r-- | main.go | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -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") } |
