Output python version and implementation as part of --version
flag (#2997)
Example: black, 22.1.1.dev56+g421383d.d20220405 (compiled: no) Python (CPython) 3.9.12 Co-authored-by: Batuhan Taskaya <isidentical@gmail.com>
This commit is contained in:
parent
9b307405fb
commit
f6188ce6dc
@ -37,6 +37,8 @@
|
|||||||
|
|
||||||
<!-- Changes to Black's terminal output and error messages -->
|
<!-- Changes to Black's terminal output and error messages -->
|
||||||
|
|
||||||
|
- Output python version and implementation as part of `--version` flag (#2997)
|
||||||
|
|
||||||
### Packaging
|
### Packaging
|
||||||
|
|
||||||
<!-- Changes to how Black is packaged, such as dependency requirements -->
|
<!-- Changes to how Black is packaged, such as dependency requirements -->
|
||||||
|
@ -10,6 +10,7 @@
|
|||||||
import os
|
import os
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from pathspec.patterns.gitwildmatch import GitWildMatchPatternError
|
from pathspec.patterns.gitwildmatch import GitWildMatchPatternError
|
||||||
|
import platform
|
||||||
import re
|
import re
|
||||||
import signal
|
import signal
|
||||||
import sys
|
import sys
|
||||||
@ -381,7 +382,10 @@ def validate_regex(
|
|||||||
)
|
)
|
||||||
@click.version_option(
|
@click.version_option(
|
||||||
version=__version__,
|
version=__version__,
|
||||||
message=f"%(prog)s, %(version)s (compiled: {'yes' if COMPILED else 'no'})",
|
message=(
|
||||||
|
f"%(prog)s, %(version)s (compiled: {'yes' if COMPILED else 'no'})\n"
|
||||||
|
f"Python ({platform.python_implementation()}) {platform.python_version()}"
|
||||||
|
),
|
||||||
)
|
)
|
||||||
@click.argument(
|
@click.argument(
|
||||||
"src",
|
"src",
|
||||||
|
Loading…
Reference in New Issue
Block a user