Skip to content

Commit

Permalink
clean up flask --version code
Browse files Browse the repository at this point in the history
  • Loading branch information
davidism committed Jan 7, 2019
1 parent 3fd51c6 commit 679fa78
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions flask/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@
import ast
import inspect
import os
import platform
import re
import ssl
import sys
import traceback
from functools import update_wrapper
from operator import attrgetter
from threading import Lock, Thread
import werkzeug

import click
from werkzeug.utils import import_string
Expand Down Expand Up @@ -260,11 +260,16 @@ def locate_app(script_info, module_name, app_name, raise_if_not_found=True):
def get_version(ctx, param, value):
if not value or ctx.resilient_parsing:
return
message = 'Python %(python_version)s\nFlask %(version)s\nWerkzeug %(werkzeug_version)s'
import werkzeug
message = (
'Python %(python)s\n'
'Flask %(flask)s\n'
'Werkzeug %(werkzeug)s'
)
click.echo(message % {
'version': __version__,
'python_version': sys.version,
'werkzeug_version': werkzeug.__version__,
'python': platform.python_version(),
'flask': __version__,
'werkzeug': werkzeug.__version__,
}, color=ctx.color)
ctx.exit()

Expand Down

0 comments on commit 679fa78

Please sign in to comment.