summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDirk Baechle <dl9obn@darc.de>2012-01-10 21:49:24 +0100
committerDirk Baechle <dl9obn@darc.de>2012-01-10 21:49:24 +0100
commit49778dc452463b2e9f801c95a0154163f149530c (patch)
tree781f1c3bec1a0dc02b836d976f7b768935a2ecc5
parent0bcd0aa4dffd7f75cb9142f9b2f2c152d0f52a64 (diff)
downloadscons-49778dc452463b2e9f801c95a0154163f149530c.tar.gz
- fix for issue #2809, corrected documentation for command-line variables
-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 abf8953c..42f8e2e8 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 1bb84e26..49edf8ac 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>