diff options
Diffstat (limited to '')
-rw-r--r-- | project/version.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/project/version.py b/project/version.py new file mode 100644 index 0000000..8cff333 --- /dev/null +++ b/project/version.py @@ -0,0 +1,15 @@ +try: + import importlib.metadata as metadata +except ImportError: + import importlib_metadata as metadata + + +try: + __version__ = metadata.version('cmake_common') +except Exception: + __version__ = 'unknown' + + +def add_to_arg_parser(parser): + parser.add_argument('--version', '-V', action='version', + version=f'%(prog)s {__version__}') |