Skip to content

Commit

Permalink
Merge pull request #453 from vaidyasm/fix_arg_version
Browse files Browse the repository at this point in the history
Handle "--version" argument via argparser.

Otherwise, it was necessary to supply a username to get the version of the program.
  • Loading branch information
rbrito authored Nov 1, 2017
2 parents 94f8d9b + 4c55314 commit 7874df9
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions edx_dl/edx_dl.py
Original file line number Diff line number Diff line change
Expand Up @@ -386,16 +386,12 @@ def parse_args():
help='print lots of debug information')

parser.add_argument('--version',
dest='version',
action='store_true',
default=False,
action='version',
version=__version__,
help='display version and exit')

args = parser.parse_args()

if args.version:
print(__version__)
sys.exit(ExitCode.OK)

# Initialize the logging system first so that other functions
# can use it right away.
Expand Down

0 comments on commit 7874df9

Please sign in to comment.