Merrill, I've committed a fix for this to cvs.
$ NAnt.exe -D:test will now result in the following error : NAnt 0.85 (Build 0.85.1666.0; net-1.1.win32; nightly; 24/07/2004) Copyright (C) 2001-2004 Gerry Shaw http://nant.sourceforge.net Invalid value 'test' for command-line argument '-D'. Expected name/value pair (<name>=<value>). Try 'nant -help' for more information I've also added a check that prevents duplicate property named : $ NAnt.exe -D:test= -D:test= will now result in the following error : NAnt 0.85 (Build 0.85.1666.0; net-1.1.win32; nightly; 24/07/2004) Copyright (C) 2001-2004 Gerry Shaw http://nant.sourceforge.net Duplicate property named 'test' for command-line argument 'D'. Hope this helps, Gert ----- Original Message ----- From: "Merrill Cornish" <[EMAIL PROTECTED]> To: "Martin Gainty" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Friday, July 23, 2004 8:17 PM Subject: RE: [Nant-users] -D:param Missing a value > Martin, > > Either I don't understand your reply, or I didn't make myself clear. Let me give an example: > > My NAnt script takes an optional boolean command line parameter named "simulator" which defaults to false. In the script, I check property::exists('simulator'). If it is false, meaning the user didn't specify the parameter or specified it as false, I explicitly set the simulator property to "false". If the simulator property DOES exist, I validate that is it either "true" or "false". In this way, I cover the cases where > > * there is no -D:simulator=x parameter on the command line (which I default to false), > > * there is -D:simulator=true parameter, > > * there is -D:simulator=false parameter, or > > * there is -D:simulator=xxx (which generates a <fail>). > > The one things I don't cover is a command line line containing > > -D:simulator > > with no equal sign after it, or > > -D:simulator= > > with no value after the equal sign. Inside the script, and equal-less -D parameter tests as "does not exist." The problem here, of course, is that many programs accept the mere mention of a boolean parameter as being the same as set to true. So, some user have gotten used to simply listing boolean parameters under the assumption that mention makes them true. > > If a -D command line parameter is malformed (e.g., no equal sign or no value after the equal sign), I would like to be able to detect it and report it to the user. On the other hand, if such a -D command is actually illegal as far as NAnt is concerned, I would like for NAnt to flagged the error itself. > > By the way, in 0.85, <available> is deprecated. > > Merrill > > > > > ------------------------------------------------------- > This SF.Net email is sponsored by BEA Weblogic Workshop > FREE Java Enterprise J2EE developer tools! > Get your free copy of BEA WebLogic Workshop 8.1 today. > http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click > _______________________________________________ > Nant-users mailing list > [EMAIL PROTECTED] > https://lists.sourceforge.net/lists/listinfo/nant-users > ------------------------------------------------------- This SF.Net email is sponsored by BEA Weblogic Workshop FREE Java Enterprise J2EE developer tools! Get your free copy of BEA WebLogic Workshop 8.1 today. http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click _______________________________________________ Nant-users mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/nant-users