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