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:
37 <scons_example name="ex1">
38 <file name="SConstruct" printme="1">
40 Type: 'scons program' to build the production program,
41 'scons debug' to build the debug version.
48 (Note the above use of the Python triple-quote syntax,
49 which comes in very handy for
50 specifying multi-line strings like help text.)
56 When the &SConstruct; or &SConscript; files
57 contain such a call to the &Help; function,
58 the specified help text will be displayed in response to
59 the &SCons; <literal>-h</literal> option:
63 <scons_output example="ex1">
64 <scons_output_command>scons -h</scons_output_command>
69 The &SConscript; files may contain
70 multiple calls to the &Help; function,
71 in which case the specified text(s)
72 will be concatenated when displayed.
73 This allows you to split up the
74 help text across multiple &SConscript; files.
75 In this situation, the order in
76 which the &SConscript; files are called
77 will determine the order in which the &Help; functions are called,
78 which will determine the order in which
79 the various bits of text will get concatenated.
85 Another use would be to make the help text conditional
87 For example, suppose you only want to display
88 a line about building a Windows-only
89 version of a program when actually
91 The following &SConstruct; file:
95 <scons_example name="ex2">
96 <file name="SConstruct" printme="1">
99 Help("\nType: 'scons program' to build the production program.\n")
101 if env['PLATFORM'] == 'win32':
102 Help("\nType: 'scons windebug' to build the Windows debug version.\n")
108 Will display the complete help text on Windows:
112 <scons_output example="ex2" os="win32">
113 <scons_output_command>scons -h</scons_output_command>
118 But only show the relevant option on a Linux or UNIX system:
122 <scons_output example="ex2" os="posix">
123 <scons_output_command>scons -h</scons_output_command>
128 If there is no &Help; text in the &SConstruct; or
130 &SCons; will revert to displaying its
131 standard list that describes the &SCons; command-line
133 This list is also always displayed whenever
134 the <literal>-H</literal> option is used.