From b531dca656a2801f1378b4176d87aed7aca6b699 Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Mon, 10 Feb 2020 22:31:23 +0500 Subject: [PATCH] output version --- cli/cliParser.py | 11 ----------- cli/cyberPanel.py | 10 ++++++++++ 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/cli/cliParser.py b/cli/cliParser.py index 8d5ed94d9..3fae89593 100755 --- a/cli/cliParser.py +++ b/cli/cliParser.py @@ -54,15 +54,4 @@ class cliParser: parser.add_argument('--userName', help='Email Username.') parser.add_argument('--password', help='Email password.') - ## Get CurrentVersion - with open('/usr/local/CyberCP/version.txt') as file: - file_contents = file.read() - version = re.search('\d.\d', file_contents) - version = version.group() - build = file_contents[-2:] - build = build[0:1] - currentversion = version + '.' + build - parser.add_argument('--version', action='version', version=currentversion) - parser.parse_args(['--version']) - return parser.parse_args() \ No newline at end of file diff --git a/cli/cyberPanel.py b/cli/cyberPanel.py index 8b0c58018..e2e6c98c7 100755 --- a/cli/cyberPanel.py +++ b/cli/cyberPanel.py @@ -1312,6 +1312,16 @@ def main(): command = '/usr/bin/cyberpanel_utility --help' ProcessUtilities.executioner(command) + elif args.function == 'version' or args.function == 'v' or args.function == 'V': + ## Get CurrentVersion + with open('/usr/local/CyberCP/version.txt') as file: + file_contents = file.read() + version = re.search('\d.\d', file_contents) + version = version.group() + build = file_contents[-2:] + build = build[0:1] + currentversion = version + '.' + build + print (currentversion)