spack python: add --path option (#22006)

This adds a `--path` option to `spack python` that shows the `python`
interpreter that Spack is using.

e.g.:

```console
$ spack python --path
/Users/gamblin2/src/spack/var/spack/environments/default/.spack-env/view/bin/python
```

This is useful for debugging, and we can ask users to run it to
understand what python Spack is picking up via preferences in `bin/spack`
and via the `SPACK_PYTHON` environment variable introduced in #21222.
This commit is contained in:
Todd Gamblin
2021-03-07 13:37:26 -08:00
committed by GitHub
parent 7aa5cc241d
commit 8d3272f82d
3 changed files with 14 additions and 1 deletions

View File

@@ -1385,7 +1385,7 @@ _spack_pydoc() {
_spack_python() {
if $list_options
then
SPACK_COMPREPLY="-h --help -V --version -c -i -m"
SPACK_COMPREPLY="-h --help -V --version -c -i -m --path"
else
SPACK_COMPREPLY=""
fi