summaryrefslogtreecommitdiff
path: root/doc/user/command-line.xml
diff options
context:
space:
mode:
authorLuca Falavigna <dktrkranz@debian.org>2012-08-20 23:30:35 +0200
committerLuca Falavigna <dktrkranz@debian.org>2012-08-20 23:30:35 +0200
commit82c4addb364fffb1c647ff7e5fab201000719305 (patch)
treecc244c59579c58d9e8df6e157d8fc49510e0f494 /doc/user/command-line.xml
parentfa0c16e75fd6770db0a9eb67a37a9b420ba3fa4f (diff)
parent3d529f4ea2b0de42aa2144dbe904e564b7b0b813 (diff)
Merge tag 'upstream/2.2.0'
Upstream version 2.2.0
Diffstat (limited to 'doc/user/command-line.xml')
-rw-r--r--doc/user/command-line.xml32
1 files changed, 25 insertions, 7 deletions
diff --git a/doc/user/command-line.xml b/doc/user/command-line.xml
index f06442e..a4a6107 100644
--- a/doc/user/command-line.xml
+++ b/doc/user/command-line.xml
@@ -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
@@ -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>