diff options
author | Steven Knight <knight@baldmt.com> | 2003-04-13 13:25:12 (GMT) |
---|---|---|
committer | Steven Knight <knight@baldmt.com> | 2003-04-13 13:25:12 (GMT) |
commit | 06e013ecd55e950a6059ced4150304c346d1da36 (patch) | |
tree | fc8bf31a334f55bca5af8440512999baea81f4bb /test/Options.py | |
parent | 5a50b311a2197c327b0b53b302801406289c1fad (diff) | |
download | SCons-06e013ecd55e950a6059ced4150304c346d1da36.zip SCons-06e013ecd55e950a6059ced4150304c346d1da36.tar.gz SCons-06e013ecd55e950a6059ced4150304c346d1da36.tar.bz2 |
Add an argument for sorting Options help text.
Diffstat (limited to 'test/Options.py')
-rw-r--r-- | test/Options.py | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/test/Options.py b/test/Options.py index 5742407..7d85076 100644 --- a/test/Options.py +++ b/test/Options.py @@ -258,4 +258,54 @@ test.run(arguments='"DEBUG_BUILD=0"') check(['0','0']) checkSave('options.saved',{'DEBUG_BUILD':'0'}) +test.write('SConstruct', """ +opts = Options('custom.py') +opts.Add('RELEASE_BUILD', + 'Set to 1 to build a release build', + 0, + None, + int) + +opts.Add('DEBUG_BUILD', + 'Set to 1 to build a debug build', + 1, + None, + int) + +opts.Add('CC', + 'The C compiler') + +opts.Add('UNSPECIFIED', + 'An option with no value') + +env = Environment(options=opts) + +Help('Variables settable in custom.py or on the command line:\\n' + opts.GenerateHelpText(env,sort=cmp)) + +""") + +test.run(arguments='-h', + stdout = """scons: Reading SConscript files ... +scons: done reading SConscript files. +Variables settable in custom.py or on the command line: + +CC: The C compiler + default: None + actual: %s + +DEBUG_BUILD: Set to 1 to build a debug build + default: 1 + actual: 0 + +RELEASE_BUILD: Set to 1 to build a release build + default: 0 + actual: 1 + +UNSPECIFIED: An option with no value + default: None + actual: None + +Use scons -H for help about command-line options. +"""%cc) + test.pass_test() |