summaryrefslogtreecommitdiff
path: root/share
diff options
context:
space:
mode:
authorPeter Scheibel <scheibel1@llnl.gov>2024-01-18 00:21:17 -0800
committerGitHub <noreply@github.com>2024-01-18 00:21:17 -0800
commit7b27591321fca14c519e75a3ab76a7e231347594 (patch)
tree2e6e44f3425b07ffdcf49a5f1882754c3ca235f5 /share
parent95390370969c5e12777c4e4e542f5d6dd6ede5dc (diff)
downloadspack-7b27591321fca14c519e75a3ab76a7e231347594.tar.gz
spack-7b27591321fca14c519e75a3ab76a7e231347594.tar.bz2
spack-7b27591321fca14c519e75a3ab76a7e231347594.tar.xz
spack-7b27591321fca14c519e75a3ab76a7e231347594.zip
New command: `spack config change` (#41147)
Like `spack change` for specs in environments, this can e.g. replace `examplespec+debug` with `examplespec~debug` in a `require:` section. Example behavior for a config like: ``` packages: foo: require: - spec: +debug ``` * `spack config change packages:foo:require:~debug` replaces `+debug` with `~debug` * `spack config change packages:foo:require:@1.1` adds a requirement to the list * `spack config change packages:bar:require:~debug` adds a requirement
Diffstat (limited to 'share')
-rwxr-xr-xshare/spack/spack-completion.bash11
-rwxr-xr-xshare/spack/spack-completion.fish9
2 files changed, 19 insertions, 1 deletions
diff --git a/share/spack/spack-completion.bash b/share/spack/spack-completion.bash
index 0c002aafc3..abc6db10d1 100755
--- a/share/spack/spack-completion.bash
+++ b/share/spack/spack-completion.bash
@@ -824,7 +824,7 @@ _spack_config() {
then
SPACK_COMPREPLY="-h --help --scope"
else
- SPACK_COMPREPLY="get blame edit list add prefer-upstream remove rm update revert"
+ SPACK_COMPREPLY="get blame edit list add change prefer-upstream remove rm update revert"
fi
}
@@ -868,6 +868,15 @@ _spack_config_add() {
fi
}
+_spack_config_change() {
+ if $list_options
+ then
+ SPACK_COMPREPLY="-h --help --match-spec"
+ else
+ SPACK_COMPREPLY=""
+ fi
+}
+
_spack_config_prefer_upstream() {
SPACK_COMPREPLY="-h --help --local"
}
diff --git a/share/spack/spack-completion.fish b/share/spack/spack-completion.fish
index 1f597badb4..10c92bc6f1 100755
--- a/share/spack/spack-completion.fish
+++ b/share/spack/spack-completion.fish
@@ -1165,6 +1165,7 @@ complete -c spack -n '__fish_spack_using_command_pos 0 config' -f -a blame -d 'p
complete -c spack -n '__fish_spack_using_command_pos 0 config' -f -a edit -d 'edit configuration file'
complete -c spack -n '__fish_spack_using_command_pos 0 config' -f -a list -d 'list configuration sections'
complete -c spack -n '__fish_spack_using_command_pos 0 config' -f -a add -d 'add configuration parameters'
+complete -c spack -n '__fish_spack_using_command_pos 0 config' -f -a change -d 'swap variants etc. on specs in config'
complete -c spack -n '__fish_spack_using_command_pos 0 config' -f -a prefer-upstream -d 'set package preferences from upstream'
complete -c spack -n '__fish_spack_using_command_pos 0 config' -f -a remove -d 'remove configuration parameters'
complete -c spack -n '__fish_spack_using_command_pos 0 config' -f -a rm -d 'remove configuration parameters'
@@ -1208,6 +1209,14 @@ complete -c spack -n '__fish_spack_using_command config add' -s h -l help -d 'sh
complete -c spack -n '__fish_spack_using_command config add' -s f -l file -r -f -a file
complete -c spack -n '__fish_spack_using_command config add' -s f -l file -r -d 'file from which to set all config values'
+# spack config change
+set -g __fish_spack_optspecs_spack_config_change h/help match-spec=
+complete -c spack -n '__fish_spack_using_command_pos 0 config change' -f -a '(__fish_spack_colon_path)'
+complete -c spack -n '__fish_spack_using_command config change' -s h -l help -f -a help
+complete -c spack -n '__fish_spack_using_command config change' -s h -l help -d 'show this help message and exit'
+complete -c spack -n '__fish_spack_using_command config change' -l match-spec -r -f -a match_spec
+complete -c spack -n '__fish_spack_using_command config change' -l match-spec -r -d 'only change constraints that match this'
+
# spack config prefer-upstream
set -g __fish_spack_optspecs_spack_config_prefer_upstream h/help local
complete -c spack -n '__fish_spack_using_command config prefer-upstream' -s h -l help -f -a help