diff options
| author | Gary Oberbrunner <garyo@oberbrunner.com> | 2012-03-03 14:04:19 (GMT) |
|---|---|---|
| committer | Gary Oberbrunner <garyo@oberbrunner.com> | 2012-03-03 14:04:19 (GMT) |
| commit | e0f48a0bcd13dbeb242d34cb7ff4a88944d8be8d (patch) | |
| tree | 4a9d7848f5acfc8c732bc10495d1207e4332b0f9 | |
| parent | 7db7f301f6b29b9e739b632535cb138a5d146121 (diff) | |
| parent | f545565f60f55af38e36f93ee9d75386aa0cd5d8 (diff) | |
| download | SCons-e0f48a0bcd13dbeb242d34cb7ff4a88944d8be8d.zip SCons-e0f48a0bcd13dbeb242d34cb7ff4a88944d8be8d.tar.gz SCons-e0f48a0bcd13dbeb242d34cb7ff4a88944d8be8d.tar.bz2 | |
Merged in dirkbaechle/scons/issue2809 (pull request #14)
| -rw-r--r-- | doc/user/command-line.in | 28 | ||||
| -rw-r--r-- | doc/user/command-line.xml | 28 |
2 files changed, 46 insertions, 10 deletions
diff --git a/doc/user/command-line.in b/doc/user/command-line.in index abf8953..42f8e2e 100644 --- a/doc/user/command-line.in +++ b/doc/user/command-line.in @@ -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> diff --git a/doc/user/command-line.xml b/doc/user/command-line.xml index 1bb84e2..49edf8a 100644 --- a/doc/user/command-line.xml +++ b/doc/user/command-line.xml @@ -875,7 +875,7 @@ </para> <programlisting> - 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}'}) @@ -885,8 +885,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> @@ -928,7 +929,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. @@ -960,7 +961,7 @@ </para> <programlisting> - 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)) @@ -1069,6 +1070,23 @@ cc -o foo foo.o bar.o </screen> + <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> |
