summaryrefslogtreecommitdiff
path: root/share
diff options
context:
space:
mode:
Diffstat (limited to 'share')
-rw-r--r--share/spack/csh/spack.csh1
-rwxr-xr-xshare/spack/qa/setup-env-test.fish3
-rwxr-xr-xshare/spack/qa/setup-env-test.sh3
-rwxr-xr-xshare/spack/setup-env.fish5
-rwxr-xr-xshare/spack/setup-env.sh1
-rwxr-xr-xshare/spack/spack-completion.bash2
6 files changed, 14 insertions, 1 deletions
diff --git a/share/spack/csh/spack.csh b/share/spack/csh/spack.csh
index 7b6bcbf929..b105f4fa89 100644
--- a/share/spack/csh/spack.csh
+++ b/share/spack/csh/spack.csh
@@ -148,6 +148,7 @@ case unload:
# argument and specs with "-h" in the name.
if ( " $_sp_spec" =~ "* --sh*" || \
" $_sp_spec" =~ "* --csh*" || \
+ " $_sp_spec" =~ "* --list*" || \
" $_sp_spec" =~ "* -h*" || \
" $_sp_spec" =~ "* --help*") then
# Args contain --sh, --csh, or -h/--help: just execute.
diff --git a/share/spack/qa/setup-env-test.fish b/share/spack/qa/setup-env-test.fish
index eaa1e34cee..a7ba965033 100755
--- a/share/spack/qa/setup-env-test.fish
+++ b/share/spack/qa/setup-env-test.fish
@@ -337,6 +337,9 @@ set _a_ld $_a_loc"/lib"
spt_contains "set -gx LD_LIBRARY_PATH $_b_ld" spack -m load --only package --fish b
spt_succeeds spack -m load b
+set LIST_CONTENT (spack -m load b; spack load --list)
+spt_contains "b@" echo $LIST_CONTENT
+spt_does_not_contain "a@" echo $LIST_CONTENT
# test a variable MacOS clears and one it doesn't for recursive loads
spt_contains "set -gx LD_LIBRARY_PATH $_a_ld:$_b_ld" spack -m load --fish a
spt_succeeds spack -m load --only dependencies a
diff --git a/share/spack/qa/setup-env-test.sh b/share/spack/qa/setup-env-test.sh
index b93ac6c0e6..d575cc6f08 100755
--- a/share/spack/qa/setup-env-test.sh
+++ b/share/spack/qa/setup-env-test.sh
@@ -106,6 +106,9 @@ contains "usage: spack module " spack -m module
title 'Testing `spack load`'
contains "export PATH=$(spack -m location -i b)/bin" spack -m load --only package --sh b
succeeds spack -m load b
+LIST_CONTENT=`spack -m load b; spack load --list`
+contains "b@" echo $LIST_CONTENT
+does_not_contain "a@" echo $LIST_CONTENT
fails spack -m load -l
# test a variable MacOS clears and one it doesn't for recursive loads
contains "export PATH=$(spack -m location -i a)/bin:$(spack -m location -i b)/bin" spack -m load --sh a
diff --git a/share/spack/setup-env.fish b/share/spack/setup-env.fish
index 85a453d1c4..d16ee617df 100755
--- a/share/spack/setup-env.fish
+++ b/share/spack/setup-env.fish
@@ -320,6 +320,11 @@ function check_env_activate_flags -d "check spack env subcommand flags for -h, -
return 0
end
+ # looks for a single `--list`
+ if match_flag $_a "--list"
+ return 0
+ end
+
end
return 1
diff --git a/share/spack/setup-env.sh b/share/spack/setup-env.sh
index eb364a3809..5136e8a58a 100755
--- a/share/spack/setup-env.sh
+++ b/share/spack/setup-env.sh
@@ -180,6 +180,7 @@ _spack_shell_wrapper() {
if [ "${_a#* --sh}" != "$_a" ] || \
[ "${_a#* --csh}" != "$_a" ] || \
[ "${_a#* -h}" != "$_a" ] || \
+ [ "${_a#* --list}" != "$_a" ] || \
[ "${_a#* --help}" != "$_a" ];
then
# Args contain --sh, --csh, or -h/--help: just execute.
diff --git a/share/spack/spack-completion.bash b/share/spack/spack-completion.bash
index 1b9f45eae2..e9022d47bb 100755
--- a/share/spack/spack-completion.bash
+++ b/share/spack/spack-completion.bash
@@ -1215,7 +1215,7 @@ _spack_list() {
_spack_load() {
if $list_options
then
- SPACK_COMPREPLY="-h --help --sh --csh --fish --first --only"
+ SPACK_COMPREPLY="-h --help --sh --csh --fish --first --only --list"
else
_installed_packages
fi