It is not an either-or situation. Here is an alternative run where I combined 
case-lambda with command-line: 

> $ ./manage hello -t world -d good
> (the-mandatory-argument: hello #t)
> (-t #f)
> (-d good)
> (files: ())

The script is this now: 

#! /bin/sh
#|
exec racket -tm "$0" ${1+"$@"}
|#
#lang racket 

(provide 
  main)

(define main
  (case-lambda
    [(the-mandatory-argument . others)
     (displayln
       `(the-mandatory-argument:
          ,the-mandatory-argument
          ,(string? the-mandatory-argument)))
     (command-line
       #:program "manage"
       #:argv others
       #:usage-help "\n Copy <files> at a limited rate"
       #:once-each
       [("-t") time "the duration of <time> in seconds between each copy; 
default: 5"
        (displayln `(-t ,(string->number time)))]
       [("-d") dest "the directory to which <files> will be copied; default: ."
        (displayln `(-d ,dest))]
       #:args files
       (displayln `(files: ,files)))]
    [() (displayln '(help me make it through the night))]))







> On Nov 13, 2015, at 11:10 PM, Christopher Walborn <tuir...@gmail.com> wrote:
> 
> Oh, interesting. There's several new things in there for me to explore. Thank 
> you. (And nice Beatles reference.) 
> 
> If you don't mind explaining -- what are the trade-offs between this approach 
> and using the arg parsing features of racket/cmdline?
> 
> Thanks,
> Christopher
> 

-- 
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