diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2015-03-13 22:42:47 +0200 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2015-03-13 22:42:47 +0200 |
commit | ef180676c2f851f989771de4c44f85d44c5e93cc (patch) | |
tree | 1ace49b043b7b72d9a27b0965f6e14e3c2613687 /meson.py | |
parent | f8593a13ce80de1257bbd2dfcc3c0685782ed457 (diff) | |
download | meson-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-x | meson.py | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -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]) |