.B -h
argument is given to
.BR scons .
-This function can be called multiple times to print multiple help messages.
+.B scons
+will exit after printing out the help text.
.TP
.RI BuildDir( build_dir ", " src_dir )
/usr/lib/scons/SCons/Scanner/Prog.pyc
/usr/lib/scons/SCons/Scanner/__init__.py
/usr/lib/scons/SCons/Scanner/__init__.pyc
-/usr/lib/scons/SCons/Script.py
-/usr/lib/scons/SCons/Script.pyc
+/usr/lib/scons/SCons/Script/__init__.py
+/usr/lib/scons/SCons/Script/__init__.pyc
+/usr/lib/scons/SCons/Script/SConscript.py
+/usr/lib/scons/SCons/Script/SConscript.pyc
/usr/lib/scons/SCons/Sig/MD5.py
/usr/lib/scons/SCons/Sig/MD5.pyc
/usr/lib/scons/SCons/Sig/TimeStamp.py
SCons/Scanner/__init__.py
SCons/Scanner/C.py
SCons/Scanner/Prog.py
-SCons/SConscript.py
-SCons/Script.py
+SCons/Script/SConscript.py
+SCons/Script/__init__.py
SCons/Sig/__init__.py
SCons/Sig/MD5.py
SCons/Sig/TimeStamp.py
import sys
default_targets = []
-help_option = None
+print_help = 0
# global exports set by Export():
global_exports = {}
default_targets.append(s)
def Help(text):
- global help_option
- if help_option == 'h':
+ if print_help:
print text
print "Use scons -H for help about command-line options."
sys.exit(0)
__revision__ = "src/engine/SCons/SConscriptTests.py __REVISION__ __DATE__ __DEVELOPER__"
-import SCons.SConscript
+import SCons.Script.SConscript
# all of the SConscript.py tests are in test/SConscript.py
import SCons.Sig.MD5
from SCons.Taskmaster import Taskmaster
import SCons.Builder
-import SCons.SConscript
+import SCons.Script.SConscript
#
calc = None
ignore_errors = 0
keep_going_on_error = 0
-
+help_option = None
# utility functions
help = "Read FILE as the top-level SConstruct file.")
def opt_help(opt, arg):
- SCons.SConscript.help_option = 'h'
+ global help_option
+ help_option = 'h'
+ SCons.Script.SConscript.print_help = 1
Option(func = opt_help,
short = 'h', long = ['help'],
help = "Print defined help message, or this one.")
def opt_help_options(opt, arg):
- SCons.SConscript.help_option = 'H'
+ global help_option
+ help_option = 'H'
Option(func = opt_help_options,
short = 'H', long = ['help-options'],
scripts.append(file)
break
- if SCons.SConscript.help_option == 'H':
+ if help_option == 'H':
print UsageString()
sys.exit(0)
if not scripts:
- if SCons.SConscript.help_option == 'h':
+ if help_option == 'h':
# There's no SConstruct, but they specified -h.
# Give them the options usage now, before we fail
# trying to read a non-existent SConstruct file.
sys.path = include_dirs + sys.path
for script in scripts:
- SCons.SConscript.SConscript(script)
+ SCons.Script.SConscript.SConscript(script)
SCons.Node.FS.default_fs.chdir(SCons.Node.FS.default_fs.Top)
- if SCons.SConscript.help_option == 'h':
+ if help_option == 'h':
# They specified -h, but there was no Help() inside the
# SConscript files. Give them the options usage.
print UsageString()
sys.exit(0)
if not targets:
- targets = SCons.SConscript.default_targets
+ targets = SCons.Script.SConscript.default_targets
def Entry(x):
if isinstance(x, SCons.Node.Node):
packages = ["SCons",
"SCons.Node",
"SCons.Scanner",
- "SCons.Sig"])
+ "SCons.Sig",
+ "SCons.Script"])
'packages' : ["SCons",
"SCons.Node",
"SCons.Scanner",
- "SCons.Sig"],
+ "SCons.Sig",
+ "SCons.Script"],
'package_dir' : {'' : 'engine'},
'scripts' : ["script/scons"],
'cmdclass' : {'install_lib' : my_install_lib}
test = TestSCons.TestSCons(match = TestCmd.match_re)
test.run(stdout = "",
- stderr = """
+ stderr = r"""
SCons error: No SConstruct file found.
-File "\S+Script.py", line \d+, in _main
+File "\S+", line \d+, in \S+
""")
test.match_func = TestCmd.match_exact
test.run(arguments='-f SConstruct3',
stdout = "other errors\n",
stderr = r"""Traceback \((most recent call|innermost) last\):
- File ".*Script.py", line \d+, in main
- _main\(\)
- File ".*Script.py", line \d+, in _main
- SCons.SConscript.SConscript\(script\)
- File ".*SConscript.py", line \d+, in SConscript
- exec file in stack\[-1\].globals
+ File ".+", line \d+, in .+
+ .+
+ File ".+", line \d+, in .+
+ .+
+ File ".+", line \d+, in .+
+ .+
File "SConstruct3", line \d+, in \?
raise InternalError, 'error inside'
InternalError: error inside