Differences between revisions 16 and 17
Revision 16 as of 2007-03-31 00:01:29
Size: 649
Editor: dyn-62-56-125-135
Comment: Updated link
Revision 17 as of 2008-03-12 02:47:01
Size: 649
Editor: localhost
Comment: converted to 1.6 markup
No differences found!

You want to get the list of targets the user entered on the command line so you can preprocess them for some reason.

This example shows how you can prevent a target ('.' in this case) from being used:

 import SCons.Script
 import sys

 all_args = sys.argv[1:]
 parser = SCons.Script.OptParser()
 options, targets = parser.parse_args(all_args)
 #print `targets`

 if ('.' in targets):
   print "You may not use '.', please use 'all' or name a specific target."
   Exit(0)

 env = Environment()
 env.Alias('all', ['.'])

(What about COMMAND_LINE_TARGETS? http://www.scons.org/doc/0.96.95/HTML/scons-user/x1301.html )

GetTargets (last edited 2008-03-12 02:47:01 by localhost)