English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
Arg parsing
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2004-10-26 (20:13)
From: William Lovas <wlovas@s...>
Subject: Re: [Caml-list] Arg parsing
Hi Thomas,

On Tue, Oct 26, 2004 at 09:56:30PM +0200, Thomas Fischbacher wrote:
> I think it would be helpful if ocaml had an '--' arg that tells it to stop 
> its own arg parsing and pass the following args on to the program started, 
> as in:
> tf@ouija:~$ perl -e 'print @ARGV' -- one tooth ree
> onetoothree

You can do this with the standard Arg module.  For example:

    Arg.parse [...; ("--", Arg.Rest anon_fun, "  stop parsing options")]

See the Arg module's documentation for details.