5 Permission is hereby granted, free of charge, to any person obtaining
6 a copy of this software and associated documentation files (the
7 "Software"), to deal in the Software without restriction, including
8 without limitation the rights to use, copy, modify, merge, publish,
9 distribute, sublicense, and/or sell copies of the Software, and to
10 permit persons to whom the Software is furnished to do so, subject to
11 the following conditions:
13 The above copyright notice and this permission notice shall be included
14 in all copies or substantial portions of the Software.
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
17 KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
18 WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20 LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21 OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
28 It's often very useful to be able to give
29 users some help that describes the
30 specific targets, build options, etc.,
31 that can be used for your build.
32 &SCons; provides the &Help; function
33 to allow you to specify this help text:
39 Type: 'scons program' to build the production program,
40 'scons debug' to build the debug version.
46 (Note the above use of the Python triple-quote syntax,
47 which comes in very handy for
48 specifying multi-line strings like help text.)
54 When the &SConstruct; or &SConscript; files
55 contain such a call to the &Help; function,
56 the specified help text will be displayed in response to
57 the &SCons; <literal>-h</literal> option:
62 % <userinput>scons -h</userinput>
63 scons: Reading SConscript files ...
64 scons: done reading SConscript files.
66 Type: 'scons program' to build the production program,
67 'scons debug' to build the debug version.
69 Use scons -H for help about command-line options.
74 The &SConscript; files may contain
75 multiple calls to the &Help; function,
76 in which case the specified text(s)
77 will be concatenated when displayed.
78 This allows you to split up the
79 help text across multiple &SConscript; files.
80 In this situation, the order in
81 which the &SConscript; files are called
82 will determine the order in which the &Help; functions are called,
83 which will determine the order in which
84 the various bits of text will get concatenated.
90 Another use would be to make the help text conditional
92 For example, suppose you only want to display
93 a line about building a Windows-only
94 version of a program when actually
96 The following &SConstruct; file:
103 Help("\nType: 'scons program' to build the production program.\n")
105 if env['PLATFORM'] == 'win32':
106 Help("\nType: 'scons windebug' to build the Windows debug version.\n")
111 Will display the complete help text on Windows:
116 C:\><userinput>scons -h</userinput>
117 scons: Reading SConscript files ...
118 scons: done reading SConscript files.
120 Type: 'scons program' to build the production program.
122 Type: 'scons windebug' to build the Windows debug version.
124 Use scons -H for help about command-line options.
129 But only show the relevant option on a Linux or UNIX system:
134 % <userinput>scons -h</userinput>
135 scons: Reading SConscript files ...
136 scons: done reading SConscript files.
138 Type: 'scons program' to build the production program.
140 Use scons -H for help about command-line options.
145 If there is no &Help; text in the &SConstruct; or
147 &SCons; will revert to displaying its
148 standard list that describes the &SCons; command-line
150 This list is also always displayed whenever
151 the <literal>-H</literal> option is used.