Grouped all the module commands under spack module

As requested in the review all the commands meant to manage module
files have been grouped under the `spack module` command.

Unit tests have been refactored to match the new command structure.
This commit is contained in:
Massimiliano Culpo
2018-07-20 10:30:36 +02:00
committed by Todd Gamblin
parent 7cbe1aedb7
commit 35cef16974
14 changed files with 272 additions and 396 deletions

View File

@@ -121,25 +121,25 @@ function spack {
# If spack module command comes back with an error, do nothing.
case $_sp_subcommand in
"use")
if _sp_full_spec=$(command spack $_sp_flags dotkit find $_sp_subcommand_args "${_sp_spec[@]}"); then
if _sp_full_spec=$(command spack $_sp_flags module dotkit find $_sp_subcommand_args "${_sp_spec[@]}"); then
use $_sp_module_args $_sp_full_spec
else
$(exit 1)
fi ;;
"unuse")
if _sp_full_spec=$(command spack $_sp_flags dotkit find $_sp_subcommand_args "${_sp_spec[@]}"); then
if _sp_full_spec=$(command spack $_sp_flags module dotkit find $_sp_subcommand_args "${_sp_spec[@]}"); then
unuse $_sp_module_args $_sp_full_spec
else
$(exit 1)
fi ;;
"load")
if _sp_full_spec=$(command spack $_sp_flags tcl find $_sp_subcommand_args "${_sp_spec[@]}"); then
if _sp_full_spec=$(command spack $_sp_flags module tcl find $_sp_subcommand_args "${_sp_spec[@]}"); then
module load $_sp_module_args $_sp_full_spec
else
$(exit 1)
fi ;;
"unload")
if _sp_full_spec=$(command spack $_sp_flags tcl find $_sp_subcommand_args "${_sp_spec[@]}"); then
if _sp_full_spec=$(command spack $_sp_flags module tcl find $_sp_subcommand_args "${_sp_spec[@]}"); then
module unload $_sp_module_args $_sp_full_spec
else
$(exit 1)