aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-02-17 05:32:33 +0100
committerAlon Zakai <alonzakai@gmail.com>2013-02-17 05:32:33 +0100
commit0495b5b1b1b94fdcd9626a883815f3a2173d4eab (patch)
tree22afb1c8ebf2cc0c4f61b4cc24c70878963a9023
parent29244f1f86a71419919c5d0e850db7672ee38056 (diff)
show version and git revision in emcc --version
-rwxr-xr-xemcc11
1 files changed, 8 insertions, 3 deletions
diff --git a/emcc b/emcc
index ffce7363..466a1e9a 100755
--- a/emcc
+++ b/emcc
@@ -119,11 +119,16 @@ if len(sys.argv) == 1:
exit(1)
if sys.argv[1] == '--version':
- print '''emcc (Emscripten GCC-like replacement) 2.0
-Copyright (C) 2012 the Emscripten authors.
+ revision = '(unknown revision)'
+ try:
+ revision = execute(['git', 'show'], stdout=PIPE)[0].split('\n')[0]
+ except:
+ pass
+ print '''emcc (Emscripten GCC-like replacement) %s (%s)
+Copyright (C) 2013 the Emscripten authors (see AUTHORS.txt)
This is free and open source software under the MIT license.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- '''
+ ''' % (shared.EMSCRIPTEN_VERSION, revision)
exit(0)
elif sys.argv[1] == '--help':
this = os.path.basename('em++' if os.environ.get('EMMAKEN_CXX') else 'emcc')