diff options
Diffstat (limited to 'doc/user/command-line.in')
-rw-r--r-- | doc/user/command-line.in | 32 |
1 files changed, 25 insertions, 7 deletions
diff --git a/doc/user/command-line.in b/doc/user/command-line.in index 52a61ac..38bea25 100644 --- a/doc/user/command-line.in +++ b/doc/user/command-line.in @@ -1,6 +1,6 @@ <!-- - Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 The SCons Foundation + Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the @@ -62,7 +62,7 @@ Any command-line argument containing an <literal>=</literal> (equal sign) is considered a variable setting with the form - <varname>variable</varname>=<varname>value</varname> + <varname>variable</varname>=<varname>value</varname>. &SCons; provides direct access to all of the command-line variable settings, the ability to apply command-line variable settings @@ -885,7 +885,7 @@ <scons_example name="Variables1"> <file name="SConstruct" printme="1"> - vars = Variables() + vars = Variables(None, ARGUMENTS) vars.Add('RELEASE', 'Set to 1 to build for release', 0) env = Environment(variables = vars, CPPDEFINES={'RELEASE_BUILD' : '${RELEASE}'}) @@ -902,8 +902,9 @@ <para> This &SConstruct; file first creates a &Variables; object - (the <literal>vars = Variables()</literal> call), - and then uses the object's &Add; + which uses the values from the command-line options dictionary &ARGUMENTS; + (the <literal>vars = Variables(None, ARGUMENTS)</literal> call). + It then uses the object's &Add; method to indicate that the &RELEASE; variable can be set on the command line, and that its default value will be <literal>0</literal> @@ -942,7 +943,7 @@ &PathOption;, &PackageOption; and &AddOptions;. These older names still work, and you may encounter them in older - &SConscript; fles, + &SConscript; files, but they have been officially deprecated as of &SCons; version 2.0. @@ -975,7 +976,7 @@ <scons_example name="Variables_Help"> <file name="SConstruct" printme="1"> - vars = Variables('custom.py') + vars = Variables(None, ARGUMENTS) vars.Add('RELEASE', 'Set to 1 to build for release', 0) env = Environment(variables = vars) Help(vars.GenerateHelpText(env)) @@ -1098,6 +1099,23 @@ <scons_output_command>scons -Q</scons_output_command> </scons_output> + <para> + + Finally, you can combine both methods with: + + </para> + + <screen> + vars = Variables('custom.py', ARGUMENTS) + </screen> + + <para> + + where values in the option file &custom_py; get overwritten + by the ones specified on the command line. + + </para> + </section> <section> |