[Scons-users] Bug with argument parsing

Sean Houghton sean.houghton at gmail.com
Wed Feb 5 13:10:03 EST 2014


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://four.pairlist.net/pipermail/scons-users/attachments/20140205/56fdf0e0/attachment.html


More information about the Scons-users mailing list