summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2005-02-11 03:08:06 (GMT)
committerSteven Knight <knight@baldmt.com>2005-02-11 03:08:06 (GMT)
commitfdaf65d36261a72883e6ed72336dff967a535e62 (patch)
treed766eefacb1b144e4b43ad946e3630502aa47778
parentd4df6e27cf6e99bc34791dad5a4902cf83476ba2 (diff)
downloadSCons-fdaf65d36261a72883e6ed72336dff967a535e62.zip
SCons-fdaf65d36261a72883e6ed72336dff967a535e62.tar.gz
SCons-fdaf65d36261a72883e6ed72336dff967a535e62.tar.bz2
Display the help message when -u -h is supplied. (Elliot Murphy)
-rw-r--r--src/CHANGES.txt2
-rw-r--r--src/engine/SCons/Script/Main.py2
-rw-r--r--test/option-h.py17
3 files changed, 18 insertions, 3 deletions
diff --git a/src/CHANGES.txt b/src/CHANGES.txt
index de12b22..8f19860 100644
--- a/src/CHANGES.txt
+++ b/src/CHANGES.txt
@@ -221,6 +221,8 @@ RELEASE 0.97 - XXX
- Enhance the tests to guarantee persistence of ListOption
values in saved options files.
+ - Supply the help text when -h is used with the -u, -U or -D options.
+
From Christian Neeb:
- Fix the Java parser's handling of string definitions to avoid ignoring
diff --git a/src/engine/SCons/Script/Main.py b/src/engine/SCons/Script/Main.py
index 71f6d61..f50273e 100644
--- a/src/engine/SCons/Script/Main.py
+++ b/src/engine/SCons/Script/Main.py
@@ -868,8 +868,6 @@ def _main(args, parser):
if script_dir:
display("scons: Entering directory `%s'" % script_dir)
os.chdir(script_dir)
- else:
- raise SCons.Errors.UserError, "No SConstruct file found."
fs.set_toplevel_dir(os.getcwd())
diff --git a/test/option-h.py b/test/option-h.py
index e70de1b..7b36c24 100644
--- a/test/option-h.py
+++ b/test/option-h.py
@@ -31,14 +31,29 @@ import sys
test = TestSCons.TestSCons()
test.run(arguments = '-h')
+test.fail_test(string.find(test.stdout(), '-h, --help') == -1)
+
+test.run(arguments = '-u -h')
+test.fail_test(string.find(test.stdout(), '-h, --help') == -1)
+
+test.run(arguments = '-U -h')
+test.fail_test(string.find(test.stdout(), '-h, --help') == -1)
+test.run(arguments = '-D -h')
test.fail_test(string.find(test.stdout(), '-h, --help') == -1)
test.write('SConstruct', "")
test.run(arguments = '-h')
+test.fail_test(string.find(test.stdout(), '-h, --help') == -1)
+
+test.run(arguments = '-u -h')
+test.fail_test(string.find(test.stdout(), '-h, --help') == -1)
+
+test.run(arguments = '-U -h')
+test.fail_test(string.find(test.stdout(), '-h, --help') == -1)
+test.run(arguments = '-D -h')
test.fail_test(string.find(test.stdout(), '-h, --help') == -1)
test.pass_test()
-