Skip to content

Commit

Permalink
Print LIB version along with CLI version when using version command o…
Browse files Browse the repository at this point in the history
…f CLI
  • Loading branch information
Totalus committed Sep 5, 2023
1 parent 74e4764 commit 6438732
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,14 @@
# CLI code
#

import argparse, os, sys, configparser

import pkg_resources
import argparse, os, sys

from .SwiftClient import *
from .S3Client import *


CLI_VERSION = 0.3
CLI_VERSION = "0.3"
LIB_VERSION = "2.0.2" # Sync with versino in setup.cfg

parser = argparse.ArgumentParser(
prog="obs_client",
Expand All @@ -20,7 +19,7 @@

subparsers = parser.add_subparsers(dest="command", required=True, metavar='<command>', title="Commands", help="Operation to execute")

sp = subparsers.add_parser('version', help='Print CLI version')
sp = subparsers.add_parser('version', help='Print version')

sp = subparsers.add_parser('test-config', help="Test configuration and connectivity to the storage backend")
sp = subparsers.add_parser('container-list', help="List containers (see also the `ls` command)")
Expand Down Expand Up @@ -97,6 +96,7 @@ def verify_configuration() -> ObjectStorageClient:

if args.command == 'version':
print(f'Universal Object Storage CLI: {CLI_VERSION}')
print(f'Universal Object Storage LIB: {LIB_VERSION}')
exit()

client = verify_configuration() # Returns the client (or exits the script on misconfiguration)
Expand Down

0 comments on commit 6438732

Please sign in to comment.