diff --git a/openvpn/connector/main.py b/openvpn/connector/main.py index e5df786..ae588e9 100644 --- a/openvpn/connector/main.py +++ b/openvpn/connector/main.py @@ -12,6 +12,7 @@ import argparse import dbus from enum import Enum +from openvpn.connector.version import ocs_version as version from openvpn.connector.token import DecodeToken from openvpn.connector.profile import ProfileFetch, DecryptError, DownloadError from openvpn.connector.autoload import AutoloadConfig @@ -64,9 +65,16 @@ def main(): help='Do not start and configure the profile to start at boot') cli.add_argument('--dco', action='store_true', help='Use OpenVPN Data Channel Offload (DCO) by default') + cli.add_argument('--version', action='store_true', + help='Show openvpn-connector-setup version') cliopts = cli.parse_args(sys.argv[1:]) + if cliopts.version: + print('OpenVPN Connector Setup Version %s' % version) + print('Program location: %s' % sys.argv[0]) + sys.exit(0) + token = None autoload_prefix = cliopts.autoload_file_prefix[0] config_name = cliopts.name[0] diff --git a/version.py b/openvpn/connector/version.py similarity index 100% rename from version.py rename to openvpn/connector/version.py diff --git a/setup.py b/setup.py index f66b59d..910322c 100644 --- a/setup.py +++ b/setup.py @@ -9,7 +9,7 @@ from setuptools import setup, find_packages from os import path -from version import ocs_version +from openvpn.connector.version import ocs_version this_directory = path.abspath(path.dirname(__file__)) with open(path.join(this_directory, 'README.md'), encoding='utf-8') as f: