From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Delivered-To: caml-list@yquem.inria.fr Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id 3FD71BB91 for ; Sat, 22 Jan 2005 12:03:22 +0100 (CET) Received: from ptb-relay01.plus.net (ptb-relay01.plus.net [212.159.14.212]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id j0MB3L3b002217 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Sat, 22 Jan 2005 12:03:22 +0100 Received: from [80.229.56.224] (helo=chetara) by ptb-relay01.plus.net with esmtp (Exim) id 1CsJ33-0001NM-GK for caml-list@yquem.inria.fr; Sat, 22 Jan 2005 11:03:21 +0000 From: Jon Harrop Organization: University of Cambridge To: caml-list@yquem.inria.fr Subject: Re: [Caml-list] 'Pass on' argument from Arg.parse to Arg.parse_argv Date: Sat, 22 Jan 2005 11:05:26 +0000 User-Agent: KMail/1.7.1 References: <20050121164812.GA16353@furbychan.cocan.org> In-Reply-To: <20050121164812.GA16353@furbychan.cocan.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200501221105.27087.jon@jdh30.plus.com> X-Miltered: at nez-perce with ID 41F232F9.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 argv:01 wrote:01 cheers:01 48,:98 ...:98 parsed:01 argument:01 parse:02 parse:02 module:03 arg:03 arg:03 let:03 let:03 X-Spam-Checker-Version: SpamAssassin 3.0.0 (2004-09-13) on yquem.inria.fr X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.0 X-Spam-Level: On Friday 21 January 2005 16:48, Richard Jones wrote: > ... > but this unfortunately doesn't work, because the program doesn't get > beyond the StdArg call to Arg.parse before printing this error message > and exiting: > > ./prog: unknown option `--foobar'. > [followed by usage message] > > Is there a way to do this? I'd like Arg.parse to ignore unknown args. What about providing your StdArg module with a way to let you register new arguments and either let you specify how they will be parsed or parse them separately afterwards? Cheers, Jon.