diff options
author | Todd Gamblin <tgamblin@llnl.gov> | 2020-10-21 17:04:42 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-21 17:04:42 -0700 |
commit | 16e75ecac097450b2abee7ea0644929b97e45bd7 (patch) | |
tree | 67ab597d6cdf04ee32b0bda435950f759c53e8d4 /bin/spack-python | |
parent | 93e7267dcce46515e61287bfe932e2e5854ef454 (diff) | |
download | spack-16e75ecac097450b2abee7ea0644929b97e45bd7.tar.gz spack-16e75ecac097450b2abee7ea0644929b97e45bd7.tar.bz2 spack-16e75ecac097450b2abee7ea0644929b97e45bd7.tar.xz spack-16e75ecac097450b2abee7ea0644929b97e45bd7.zip |
shell support: make `which spack` output intelligible (#19256)
Zsh and newer versions of bash have a builtin `which` function that will
show you if a command is actually an alias or a function. For functions,
the entire function is printed, and our `spack()` function is quite long.
Instead of printing out all that, make the `spack()` function a wrapper
around `_spack_shell_wrapper()`, and include some no-ops in the
definition so that users can see where it was created and where Spack is
installed.
Here's what the new output looks like in zsh:
```console
$ which spack
spack () {
: this is a shell function from: /Users/gamblin2/src/spack/share/spack/setup-env.sh
: the real spack script is here: /Users/gamblin2/src/spack/bin/spack
_spack "$@"
return $?
}
```
Note that `:` is a no-op in Bourne shell; it just discards anything after
it on the line. We use it here to embed paths in the function definition
(as comments are stripped).
Diffstat (limited to 'bin/spack-python')
0 files changed, 0 insertions, 0 deletions