chiark / gitweb /
Add a "version" command
authorChuck Lever <cel@netapp.com>
Tue, 6 Sep 2005 16:12:29 +0000 (12:12 -0400)
committerCatalin Marinas <catalin.marinas@gmail.com>
Wed, 7 Sep 2005 09:39:37 +0000 (10:39 +0100)
Flesh out existing version command and expose it.

Signed-off-by: Chuck Lever <cel@netapp.com>
stgit/main.py

index e62e95bddcf6fe55dab74d9de0669b7939ea06cd..2350013d09f87238e6527247e51454d12e41f8c7 100644 (file)
@@ -91,6 +91,8 @@ def print_help():
     print
     print 'commands:'
     print '  help        print this message'
+    print '  version     display version information'
+    print
 
     cmds = commands.keys()
     cmds.sort()
@@ -116,8 +118,9 @@ def main():
     if cmd in ['-h', '--help', 'help']:
         print_help()
         sys.exit(0)
-    if cmd in ['-v', '--version']:
+    if cmd in ['-v', '--version', 'version']:
         print 'Stacked GIT %s' % version
+        print 'Python version %s' % sys.version
         sys.exit(0)
     if not cmd in commands:
         print >> sys.stderr, 'Unknown command: %s' % cmd