summaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorDirk Baechle <dl9obn@darc.de>2012-01-10 20:49:24 (GMT)
committerDirk Baechle <dl9obn@darc.de>2012-01-10 20:49:24 (GMT)
commitf545565f60f55af38e36f93ee9d75386aa0cd5d8 (patch)
tree781f1c3bec1a0dc02b836d976f7b768935a2ecc5 /doc
parent0dee7fcd44dad6209f6b9384a5b857f0c07e4267 (diff)
downloadSCons-f545565f60f55af38e36f93ee9d75386aa0cd5d8.zip
SCons-f545565f60f55af38e36f93ee9d75386aa0cd5d8.tar.gz
SCons-f545565f60f55af38e36f93ee9d75386aa0cd5d8.tar.bz2
- fix for issue #2809, corrected documentation for command-line variables
Diffstat (limited to 'doc')
-rw-r--r--doc/user/command-line.in28
-rw-r--r--doc/user/command-line.xml28
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>