[Scons-users] Bug with argument parsing

Sean Houghton sean.houghton at gmail.com
Fri Feb 7 23:11:04 EST 2014


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://four.pairlist.net/pipermail/scons-users/attachments/20140207/610ee52f/attachment.htm


More information about the Scons-users mailing list