Anonymous avatar Anonymous committed 93c234b

Fill in the -v option.

Comments (0)

Files changed (2)

 #! /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()
  
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.