caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "Till Varoquaux" <till.varoquaux@gmail.com>
To: mulhern <mulhern@gmail.com>
Cc: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] Use Arg module to read keyword followed by unspecified number of arguments
Date: Tue, 23 May 2006 19:29:09 +0200	[thread overview]
Message-ID: <9d3ec8300605231029t2ac1bc92k739b22c0a6931371@mail.gmail.com> (raw)
In-Reply-To: <54f15b6e0605231017o5f23fd07q7f7b1c5cab38cf0b@mail.gmail.com>

You could work around with references but I guess you'd consider this
as ugly. A comma separated list of strings could do the trick:
 "-pred-files", Arg.String (fun s -> predfiles:=Str.split
(Str.regexp_string ",") s),"...")

cheers,
Till
On 5/23/06, mulhern <mulhern@gmail.com> wrote:
> Hi!
>
> I expect to be reading something like this:
>
> -pred-files <arg1> <arg2> ... <argn> -key2 <arg> -extra-files <arg1>
> <arg2> ... <argn> -key4
>
> There may be 0 or more <args> specified after -pred-files and after
> -extra-files. I need to treat the args differently depending on what
> keyword they are associated with.
>
> I can think of about 10 ways to do this using the Arg module, but
> they're all ugly and all different. Does anybody have an attractive
> solution to this problem or is aware of the accepted way to handle
> this situation? An example in some existing code would be good enough.
>
> I do not consider changing the call to
> -pred-files <arg1> -pred-files <arg2> ... -pred-files <argn> ......
> an option at this time, principally because the call is automatically
> generated and I'ld like it to stay in line with the other
> automatically generated calls in the same distribution.
>
> Thanks!
>
> -mulhern
>
> _______________________________________________
> Caml-list mailing list. Subscription management:
> http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
> Archives: http://caml.inria.fr
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
> Bug reports: http://caml.inria.fr/bin/caml-bugs
>


  reply	other threads:[~2006-05-23 17:29 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-23 17:17 mulhern
2006-05-23 17:29 ` Till Varoquaux [this message]
2006-05-23 17:49 ` [Caml-list] " Oliver Bandel
2006-05-23 17:55 ` Oliver Bandel
2006-05-23 19:21 ` Michael Wohlwend
2006-05-23 19:50   ` Till Varoquaux
2006-05-23 19:57     ` Michael Wohlwend
2006-05-24 14:03 ` Richard Jones

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9d3ec8300605231029t2ac1bc92k739b22c0a6931371@mail.gmail.com \
    --to=till.varoquaux@gmail.com \
    --cc=caml-list@yquem.inria.fr \
    --cc=mulhern@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).