Skip to content

Commit

Permalink
Add --version to retrieve version and script details
Browse files Browse the repository at this point in the history
Signed-off-by: David Sommerseth <[email protected]>
  • Loading branch information
dsommers committed May 15, 2023
1 parent 6c4e475 commit 394728a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions openvpn/connector/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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]
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 394728a

Please sign in to comment.