[Scons-users] Bug with argument parsing

Gary Oberbrunner garyo at oberbrunner.com
Sat Feb 8 07:05:37 EST 2014


I confirm the problem. I haven't had time to look into a solution. A
patch would be most welcome!


On Fri, Feb 7, 2014 at 11:11 PM, Sean Houghton <sean.houghton at gmail.com>wrote:


> Tumbleweeds on this post... it's a fairly serious bug if you're adding

> extra arguments to your project and I'm surprised nobody has run in to this

> before.

>

> Does anyone use the feature that lets you type in partial command line

> arguments? I suggest this feature be removed.

>

>

> On Wed, Feb 5, 2014 at 10:10 AM, Sean Houghton <sean.houghton at gmail.com>wrote:

>

>> I've submitted this as issue 2929, but it was suggested that I post it to the mailing list for discussion.

>>

>>

>> The command line parser appears to accept 'partial' arguments and this is causing problems with local options.

>>

>>

>> Problem A:

>> Disambiguation doesn't work right when one an argument is a substring of another

>> and the longer argument is defined first.

>>

>>

>> AddOption('--myargument', dest='myargument', type='string')

>> AddOption('--myarg', dest='myarg', type='string')

>> print("myargument: " + str(GetOption('myargument')))

>> print("myarg: " + str(GetOption('myarg')))

>>

>>

>> >scons --myarg=helloworld

>> scons: Reading SConscript files ...

>> myargument: helloworld

>> myarg: None

>> scons: done reading SConscript files.

>> scons: Building targets ...

>> scons: `.' is up to date.

>> scons: done building targets.

>>

>>

>> Problem B:

>> If you add a local option that starts with the same letters as a built-in option

>> they will both be assigned the value of the built-in option.

>>

>>

>> AddOption('--cache-disable-upload', dest='cache_disable_upload',

>> action='store_true', default=False)

>> print("cache_disable_upload: " + str(GetOption('cache_disable')))

>> print("cache_disable: " + str(GetOption('cache_disable')))

>>

>> >scons --cache-disable

>> scons: Reading SConscript files ...

>> cache_disable_upload: True

>> cache_disable: True

>> scons: done reading SConscript files.

>> scons: Building targets ...

>> scons: `.' is up to date.

>> scons: done building targets.

>>

>>

>>

>> --

>> -Sean

>>

>

>

>

> --

> -Sean

>

> _______________________________________________

> Scons-users mailing list

> Scons-users at scons.org

> http://four.pairlist.net/mailman/listinfo/scons-users

>

>



--
Gary
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://four.pairlist.net/pipermail/scons-users/attachments/20140208/2f655f99/attachment.htm


More information about the Scons-users mailing list