Please note:The SCons wiki is now restored from the attack in March 2013. All old passwords have been invalidated. Please reset your password if you have an account. If you note missing pages, please report them to webmaster@scons.org. Also, new account creation is currently disabled due to an ongoing spam flood (2013/08/27).

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)