summaryrefslogtreecommitdiffstats
path: root/contrib/meson
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/meson')
-rw-r--r--contrib/meson/GetLz4LibraryVersion.py14
1 files changed, 5 insertions, 9 deletions
diff --git a/contrib/meson/GetLz4LibraryVersion.py b/contrib/meson/GetLz4LibraryVersion.py
index e929f95..80b09c9 100644
--- a/contrib/meson/GetLz4LibraryVersion.py
+++ b/contrib/meson/GetLz4LibraryVersion.py
@@ -11,11 +11,6 @@ import re
import sys
-def usage():
- print('usage: python3 GetLz4LibraryVersion.py <path/to/lz4.h>')
- sys.exit(1)
-
-
def find_version(filepath):
version_file_data = None
with open(filepath) as fd:
@@ -33,10 +28,11 @@ def find_version(filepath):
def main():
- if len(sys.argv) < 2:
- usage()
-
- filepath = sys.argv[1]
+ import argparse
+ parser = argparse.ArgumentParser(description='Print lz4 version from lib/lz4.h')
+ parser.add_argument('file', help='path to lib/lz4.h')
+ args = parser.parse_args()
+ filepath = args.file
version_tup = find_version(filepath)
print('.'.join(version_tup))