Please note:The SCons wiki is in read-only mode due to ongoing spam/DoS issues. Also, new account creation is currently disabled. We are looking into alternative wiki hosts.

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)