chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Chicken-users] Re: getopt, getopt_long?


From: William Xu
Subject: [Chicken-users] Re: getopt, getopt_long?
Date: Wed, 09 Jul 2008 12:16:16 +0900
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2.50 (darwin)

Ivan Raikov <address@hidden> writes:

> The args egg provides getopt-like functionality:

Hmm, i tried both srfi-37 and args, both don't seem very satisfactory.
For example, in the following code, "file" option requires an arg, but
when I run as it "./foo -f", it can't detect the missing required arg at
all...  

(define opts
  `(
    ,(args:make-option (v)       #:none               "set verbose mode"
                       (set! opt_v #t))
    ,(args:make-option (h help)  #:none               "Print help"
                       (usage))

    ,(args:make-option (f file)  #:required               "filename, required"
                       (print "Did it detect missing required arg and shout?"))

    ))

-- 
William

http://williamxu.net9.org

... of course, this probably only happens for tcsh which uses wait4(),
which is why I never saw it.  Serves people who use that abomination
right 8^)
        -- Linus Torvalds, about a patch that fixes getrusage for 1.3.26





reply via email to

[Prev in Thread] Current Thread [Next in Thread]