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 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."

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


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