aboutsummaryrefslogtreecommitdiff
path: root/meson.py
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2015-03-13 22:42:47 +0200
committerJussi Pakkanen <jpakkane@gmail.com>2015-03-13 22:42:47 +0200
commitef180676c2f851f989771de4c44f85d44c5e93cc (patch)
tree1ace49b043b7b72d9a27b0965f6e14e3c2613687 /meson.py
parentf8593a13ce80de1257bbd2dfcc3c0685782ed457 (diff)
downloadmeson-ef180676c2f851f989771de4c44f85d44c5e93cc.zip
meson-ef180676c2f851f989771de4c44f85d44c5e93cc.tar.gz
meson-ef180676c2f851f989771de4c44f85d44c5e93cc.tar.bz2
Add command line switch to print version number.
Diffstat (limited to 'meson.py')
-rwxr-xr-xmeson.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/meson.py b/meson.py
index 576edc8..d545a08 100755
--- a/meson.py
+++ b/meson.py
@@ -64,7 +64,9 @@ parser.add_argument('--cross-file', default=None, dest='cross_file',
help='file describing cross compilation environment')
parser.add_argument('-D', action='append', dest='projectoptions', default=[],
help='Set project options.')
-parser.add_argument('directories', nargs='+')
+parser.add_argument('-v', action='store_true', dest='print_version', default=False,
+ help='Print version.')
+parser.add_argument('directories', nargs='*')
class MesonApp():
@@ -150,6 +152,9 @@ if __name__ == '__main__':
else:
handshake = False
options = parser.parse_args(args[1:])
+ if options.print_version:
+ print(coredata.version)
+ sys.exit(0)
args = options.directories
if len(args) == 0 or len(args) > 2:
print('%s <source directory> <build directory>' % sys.argv[0])