Skip to content

Commit 0ff5c33

Browse files
committed
feat: add an option to show the python path only
Signed-off-by: Frost Ming <me@frostming.com>
1 parent 3ab7252 commit 0ff5c33

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/findpython/__main__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ def cli(argv: list[str] | None = None) -> int:
3737
parser.add_argument(
3838
"-a", "--all", action="store_true", help="Show all matching python versions"
3939
)
40+
parser.add_argument("--path", action="store_true", help="Show the path of the python")
4041
parser.add_argument(
4142
"--resolve-symlink", action="store_true", help="Resolve all symlinks"
4243
)
@@ -79,7 +80,7 @@ def cli(argv: list[str] | None = None) -> int:
7980
python_versions = [python_versions]
8081
print("Found matching python versions:", file=sys.stderr)
8182
for python_version in python_versions:
82-
print(python_version)
83+
print(python_version.executable if args.path else python_version)
8384
return 0
8485

8586

0 commit comments

Comments
 (0)