summaryrefslogtreecommitdiffstats
path: root/src/engine
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2002-03-12 04:25:03 (GMT)
committerSteven Knight <knight@baldmt.com>2002-03-12 04:25:03 (GMT)
commit815fd42ff563da2b188200db897edd809905df8d (patch)
tree8d5f2f3986c9e3f01cb27302e547110aae010cde /src/engine
parent3f2c0a0cb3e65e01263f315cc5d1a017537de1c9 (diff)
downloadSCons-815fd42ff563da2b188200db897edd809905df8d.zip
SCons-815fd42ff563da2b188200db897edd809905df8d.tar.gz
SCons-815fd42ff563da2b188200db897edd809905df8d.tar.bz2
Implement the -U option. (Steve Leblanc)
Diffstat (limited to 'src/engine')
-rw-r--r--src/engine/SCons/Script/__init__.py18
1 files changed, 15 insertions, 3 deletions
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