#! /usr/bin/env python
+#
+# SCons
+#
+
+__revision__ = "scons.py __REVISION__ __DATE__ __DEVELOPER__"
import getopt
import os.path
short = 'u', long = ['up', 'search-up'],
help = "Search up directory tree for SConstruct.")
-Option(func = opt_not_yet,
+def option_v(opt, arg):
+ print "SCons version __VERSION__, by Steven Knight et al."
+ print "Copyright 2001 Steven Knight"
+ sys.exit(0)
+
+Option(func = option_v,
short = 'v', long = ['version'],
help = "Print the SCons version number and exit.")
if __name__ == "__main__":
try:
main()
+ except SystemExit:
+ pass
except KeyboardInterrupt:
print "Build interrupted."
except SyntaxError, e:
test.run(chdir = '.', arguments = '-v')
-test.fail_test(test.stderr() !=
- "Warning: the -v option is not yet implemented\n")
+expect = r"""SCons version \S+, by Steven Knight et al.
+Copyright 2001 Steven Knight
+"""
+
+test.fail_test(not test.match_re(test.stdout(), expect))
+test.fail_test(test.stderr() != "")
test.run(chdir = '.', arguments = '--version')
-test.fail_test(test.stderr() !=
- "Warning: the --version option is not yet implemented\n")
+test.fail_test(not test.match_re(test.stdout(), expect))
+test.fail_test(test.stderr() != "")
test.pass_test()