From fdaf65d36261a72883e6ed72336dff967a535e62 Mon Sep 17 00:00:00 2001 From: Steven Knight Date: Fri, 11 Feb 2005 03:08:06 +0000 Subject: Display the help message when -u -h is supplied. (Elliot Murphy) --- src/CHANGES.txt | 2 ++ src/engine/SCons/Script/Main.py | 2 -- test/option-h.py | 17 ++++++++++++++++- 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() - -- cgit v0.12