diff options
author | Steven Knight <knight@baldmt.com> | 2002-03-12 04:25:03 (GMT) |
---|---|---|
committer | Steven Knight <knight@baldmt.com> | 2002-03-12 04:25:03 (GMT) |
commit | 815fd42ff563da2b188200db897edd809905df8d (patch) | |
tree | 8d5f2f3986c9e3f01cb27302e547110aae010cde /src | |
parent | 3f2c0a0cb3e65e01263f315cc5d1a017537de1c9 (diff) | |
download | SCons-815fd42ff563da2b188200db897edd809905df8d.zip SCons-815fd42ff563da2b188200db897edd809905df8d.tar.gz SCons-815fd42ff563da2b188200db897edd809905df8d.tar.bz2 |
Implement the -U option. (Steve Leblanc)
Diffstat (limited to 'src')
-rw-r--r-- | src/CHANGES.txt | 4 | ||||
-rw-r--r-- | src/engine/SCons/Script/__init__.py | 18 |
2 files changed, 19 insertions, 3 deletions
diff --git a/src/CHANGES.txt b/src/CHANGES.txt index fff6014..07465a6 100644 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -35,6 +35,10 @@ RELEASE 0.06 - - Fixed an exception when CPPPATH or LIBPATH is a null string. (Bug reported by Richard Kiss.) + From Steve Leblanc: + + - Add support for the -U option. + RELEASE 0.05 - Thu, 21 Feb 2002 16:50:03 -0600 diff --git a/src/engine/SCons/Script/__init__.py b/src/engine/SCons/Script/__init__.py index 84882f4..0be6653 100644 --- a/src/engine/SCons/Script/__init__.py +++ b/src/engine/SCons/Script/__init__.py @@ -542,6 +542,14 @@ def options_init(): short = 'u', long = ['up', 'search-up'], help = "Search up directory tree for SConstruct.") + def opt_U(opt, arg): + global climb_up + climb_up = 2 + + Option(func = opt_U, + short = 'U', + help = "Search up directory tree for SConstruct.") + def option_v(opt, arg): import SCons print "SCons by Steven Knight et al.:" @@ -721,12 +729,16 @@ def _main(): print UsageString() sys.exit(0) + if target_top: + if climb_up == 2 and not targets: + # -U with default targets + target_top = None + else: + target_top = SCons.Node.FS.default_fs.Dir(target_top) + if not targets: targets = SCons.Script.SConscript.default_targets - if target_top: - target_top = SCons.Node.FS.default_fs.Dir(target_top) - def Entry(x, top = target_top): if isinstance(x, SCons.Node.Node): node = x |