I don't know how to make the `command-line` syntax do this (there's no
flag-clause like `#:required-once`). So I think I'd just do a normal
test outside it:

(define destination (make-parameter #f)) ;default to #f meaning "unspecified"

(command-line
  .... your existing code ....)

(define (main)
  (unless (destination)
    (raise-user-error "The -d <destination> option is required."))
 .... your existing code ....)


p.s. Not too many versions ago Racket added a `main` submodule [1].
Using that would let other, "helper" functions be used and tested
independently.  However for what you have, now, the way you're doing
it also seems fine.

[1]: 
http://docs.racket-lang.org/guide/Module_Syntax.html#%28part._main-and-test%29

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to