summaryrefslogtreecommitdiff
path: root/share
diff options
context:
space:
mode:
authorKyle Knoepfel <knoepfel@fnal.gov>2024-03-28 16:15:04 -0500
committerGitHub <noreply@github.com>2024-03-28 15:15:04 -0600
commit5f9228746e8a203f1fee2bcb0c2188c66c9189dc (patch)
tree411e50c376255e0f7f68c91d0ebc6b5ea2c31f59 /share
parent9f2451ddff345bc938a9cf90ec7bbdd3f25b36b6 (diff)
downloadspack-5f9228746e8a203f1fee2bcb0c2188c66c9189dc.tar.gz
spack-5f9228746e8a203f1fee2bcb0c2188c66c9189dc.tar.bz2
spack-5f9228746e8a203f1fee2bcb0c2188c66c9189dc.tar.xz
spack-5f9228746e8a203f1fee2bcb0c2188c66c9189dc.zip
Add ability to rename environments (#43296)
Diffstat (limited to 'share')
-rwxr-xr-xshare/spack/spack-completion.bash20
-rwxr-xr-xshare/spack/spack-completion.fish26
2 files changed, 43 insertions, 3 deletions
diff --git a/share/spack/spack-completion.bash b/share/spack/spack-completion.bash
index dc0d1987a6..e76f757f19 100755
--- a/share/spack/spack-completion.bash
+++ b/share/spack/spack-completion.bash
@@ -1032,7 +1032,7 @@ _spack_env() {
then
SPACK_COMPREPLY="-h --help"
else
- SPACK_COMPREPLY="activate deactivate create remove rm list ls status st loads view update revert depfile"
+ SPACK_COMPREPLY="activate deactivate create remove rm rename mv list ls status st loads view update revert depfile"
fi
}
@@ -1076,6 +1076,24 @@ _spack_env_rm() {
fi
}
+_spack_env_rename() {
+ if $list_options
+ then
+ SPACK_COMPREPLY="-h --help -d --dir -f --force"
+ else
+ SPACK_COMPREPLY=""
+ fi
+}
+
+_spack_env_mv() {
+ if $list_options
+ then
+ SPACK_COMPREPLY="-h --help -d --dir -f --force"
+ else
+ SPACK_COMPREPLY=""
+ fi
+}
+
_spack_env_list() {
SPACK_COMPREPLY="-h --help"
}
diff --git a/share/spack/spack-completion.fish b/share/spack/spack-completion.fish
index ff7c3b3ba1..a8ff367416 100755
--- a/share/spack/spack-completion.fish
+++ b/share/spack/spack-completion.fish
@@ -1472,8 +1472,10 @@ complete -c spack -n '__fish_spack_using_command_pos 0 env' -f -a deactivate -d
complete -c spack -n '__fish_spack_using_command_pos 0 env' -f -a create -d 'create a new environment'
complete -c spack -n '__fish_spack_using_command_pos 0 env' -f -a remove -d 'remove an existing environment'
complete -c spack -n '__fish_spack_using_command_pos 0 env' -f -a rm -d 'remove an existing environment'
-complete -c spack -n '__fish_spack_using_command_pos 0 env' -f -a list -d 'list available environments'
-complete -c spack -n '__fish_spack_using_command_pos 0 env' -f -a ls -d 'list available environments'
+complete -c spack -n '__fish_spack_using_command_pos 0 env' -f -a rename -d 'rename an existing environment'
+complete -c spack -n '__fish_spack_using_command_pos 0 env' -f -a mv -d 'rename an existing environment'
+complete -c spack -n '__fish_spack_using_command_pos 0 env' -f -a list -d 'list managed environments'
+complete -c spack -n '__fish_spack_using_command_pos 0 env' -f -a ls -d 'list managed environments'
complete -c spack -n '__fish_spack_using_command_pos 0 env' -f -a status -d 'print whether there is an active environment'
complete -c spack -n '__fish_spack_using_command_pos 0 env' -f -a st -d 'print whether there is an active environment'
complete -c spack -n '__fish_spack_using_command_pos 0 env' -f -a loads -d 'list modules for an installed environment \'(see spack module loads)\''
@@ -1561,6 +1563,26 @@ complete -c spack -n '__fish_spack_using_command env rm' -s h -l help -d 'show t
complete -c spack -n '__fish_spack_using_command env rm' -s y -l yes-to-all -f -a yes_to_all
complete -c spack -n '__fish_spack_using_command env rm' -s y -l yes-to-all -d 'assume "yes" is the answer to every confirmation request'
+# spack env rename
+set -g __fish_spack_optspecs_spack_env_rename h/help d/dir f/force
+
+complete -c spack -n '__fish_spack_using_command env rename' -s h -l help -f -a help
+complete -c spack -n '__fish_spack_using_command env rename' -s h -l help -d 'show this help message and exit'
+complete -c spack -n '__fish_spack_using_command env rename' -s d -l dir -f -a dir
+complete -c spack -n '__fish_spack_using_command env rename' -s d -l dir -d 'the specified arguments correspond to directory paths'
+complete -c spack -n '__fish_spack_using_command env rename' -s f -l force -f -a force
+complete -c spack -n '__fish_spack_using_command env rename' -s f -l force -d 'allow overwriting of an existing environment'
+
+# spack env mv
+set -g __fish_spack_optspecs_spack_env_mv h/help d/dir f/force
+
+complete -c spack -n '__fish_spack_using_command env mv' -s h -l help -f -a help
+complete -c spack -n '__fish_spack_using_command env mv' -s h -l help -d 'show this help message and exit'
+complete -c spack -n '__fish_spack_using_command env mv' -s d -l dir -f -a dir
+complete -c spack -n '__fish_spack_using_command env mv' -s d -l dir -d 'the specified arguments correspond to directory paths'
+complete -c spack -n '__fish_spack_using_command env mv' -s f -l force -f -a force
+complete -c spack -n '__fish_spack_using_command env mv' -s f -l force -d 'allow overwriting of an existing environment'
+
# spack env list
set -g __fish_spack_optspecs_spack_env_list h/help
complete -c spack -n '__fish_spack_using_command env list' -s h -l help -f -a help