Skip to content

Commit

Permalink
Print compilation status with --version (#12318)
Browse files Browse the repository at this point in the history
Resolves #12317

Co-authored-by: hauntsaninja <>
  • Loading branch information
hauntsaninja committed Mar 9, 2022
1 parent 47e2ca8 commit 4a744b3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion mypy/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -492,9 +492,11 @@ def add_invertible_flag(flag: str,
general_group.add_argument(
'-v', '--verbose', action='count', dest='verbosity',
help="More verbose messages")

compilation_status = "no" if __file__.endswith(".py") else "yes"
general_group.add_argument(
'-V', '--version', action=CapturableVersionAction,
version='%(prog)s ' + __version__,
version='%(prog)s ' + __version__ + f" (compiled: {compilation_status})",
help="Show program's version number and exit",
stdout=stdout)

Expand Down

0 comments on commit 4a744b3

Please sign in to comment.