Skip to content

COMMAND_LINE_TARGETS doesn't deal with option values #2748

Open
@bdbaddog

Description

@bdbaddog

This issue was originally created at: 2011-03-28 16:34:01.
This issue was reported by: stever_.

stever_ said at 2011-03-28 16:34:01

There seems to be an inconsistency in handling options that take values when they're specified without an '='. This seems to be caused by the loop in _main that assigns anything that doesn't start with '-' or have an '=' in it to COMMAND_LINE_TARGETS, rather than letting the option parser figure it out properly.

Here's an example SConscript:

import sys
 
AddOption('--option')
 
print('option:', GetOption('option'))
print('targets:', COMMAND_LINE_TARGETS)
 
sys.exit(0)
'''

And here's the problem:

% scons --option=FOO BAR
scons: Reading SConscript files ...
option: FOO
targets: ['BAR']
% scons --option FOO BAR
scons: Reading SConscript files ...
option: FOO
targets: ['FOO', 'BAR']


>ipatrol said this issue blocks #2763 at 2011-05-14 12:29:10.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Version: 2.0.1args_and_optionsoptions processing, arguments, get/setoption and their relationshiopbug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions