summaryrefslogtreecommitdiff
path: root/share
diff options
context:
space:
mode:
authorWouter Deconinck <wdconinc@gmail.com>2023-08-02 06:16:14 -0500
committerGitHub <noreply@github.com>2023-08-02 11:16:14 +0000
commita14f4b5a028df4a669fbebab1e6a8f2b57288baf (patch)
tree59ab7d8f2668fc65da9c84265df5c657bee3dcb0 /share
parent3be565f49e7a694fb7cbeda6c82b3257b51f9786 (diff)
downloadspack-a14f4b5a028df4a669fbebab1e6a8f2b57288baf.tar.gz
spack-a14f4b5a028df4a669fbebab1e6a8f2b57288baf.tar.bz2
spack-a14f4b5a028df4a669fbebab1e6a8f2b57288baf.tar.xz
spack-a14f4b5a028df4a669fbebab1e6a8f2b57288baf.zip
feat: move -N/--namespace(s) to common args, allow in `buildcache list` (#36719)
`spack buildcache list` did not have a way to display the namespace of packages in the buildcache. This PR adds that functionality. For consistency's sake, it moves the `-N/--namespace` arg definition to the `common/arguments.py` and modifies `find`, `solve`, `spec` to use the common definition. Previously, `find` was using `--namespace` (singular) to control whether to display the namespace (it doesn't restrict the search to that namespace). The other commands were using `--namespaces` (plural). For backwards compatibility and for consistency with `--deps`, `--tags`, etc, the plural `--namespaces` was chosen. The argument parser ensures that `find --namespace` will continue to behave as before. Co-authored-by: Harmen Stoppels <me@harmenstoppels.nl>
Diffstat (limited to 'share')
-rwxr-xr-xshare/spack/spack-completion.bash8
-rwxr-xr-xshare/spack/spack-completion.fish22
2 files changed, 16 insertions, 14 deletions
diff --git a/share/spack/spack-completion.bash b/share/spack/spack-completion.bash
index f541070682..409bb617f8 100755
--- a/share/spack/spack-completion.bash
+++ b/share/spack/spack-completion.bash
@@ -525,7 +525,7 @@ _spack_buildcache_install() {
_spack_buildcache_list() {
if $list_options
then
- SPACK_COMPREPLY="-h --help -l --long -L --very-long -v --variants -a --allarch"
+ SPACK_COMPREPLY="-h --help -l --long -L --very-long -N --namespaces -v --variants -a --allarch"
else
_all_packages
fi
@@ -1075,7 +1075,7 @@ _spack_fetch() {
_spack_find() {
if $list_options
then
- SPACK_COMPREPLY="-h --help --format -H --hashes --json -d --deps -p --paths --groups --no-groups -l --long -L --very-long -t --tag -c --show-concretized -f --show-flags --show-full-compiler -x --explicit -X --implicit -u --unknown -m --missing -v --variants --loaded -M --only-missing --deprecated --only-deprecated -N --namespace --start-date --end-date"
+ SPACK_COMPREPLY="-h --help --format -H --hashes --json -d --deps -p --paths --groups --no-groups -l --long -L --very-long -t --tag -N --namespaces -c --show-concretized -f --show-flags --show-full-compiler -x --explicit -X --implicit -u --unknown -m --missing -v --variants --loaded -M --only-missing --deprecated --only-deprecated --start-date --end-date"
else
_installed_packages
fi
@@ -1704,7 +1704,7 @@ _spack_restage() {
_spack_solve() {
if $list_options
then
- SPACK_COMPREPLY="-h --help --show -l --long -L --very-long -I --install-status --no-install-status -y --yaml -j --json -c --cover -N --namespaces -t --types --timers --stats -U --fresh --reuse --reuse-deps"
+ SPACK_COMPREPLY="-h --help --show -l --long -L --very-long -N --namespaces -I --install-status --no-install-status -y --yaml -j --json -c --cover -t --types --timers --stats -U --fresh --reuse --reuse-deps"
else
_all_packages
fi
@@ -1713,7 +1713,7 @@ _spack_solve() {
_spack_spec() {
if $list_options
then
- SPACK_COMPREPLY="-h --help -l --long -L --very-long -I --install-status --no-install-status -y --yaml -j --json --format -c --cover -N --namespaces -t --types -U --fresh --reuse --reuse-deps"
+ SPACK_COMPREPLY="-h --help -l --long -L --very-long -N --namespaces -I --install-status --no-install-status -y --yaml -j --json --format -c --cover -t --types -U --fresh --reuse --reuse-deps"
else
_all_packages
fi
diff --git a/share/spack/spack-completion.fish b/share/spack/spack-completion.fish
index 8892c6a95e..da8b2a4da3 100755
--- a/share/spack/spack-completion.fish
+++ b/share/spack/spack-completion.fish
@@ -739,7 +739,7 @@ complete -c spack -n '__fish_spack_using_command buildcache install' -s o -l oth
complete -c spack -n '__fish_spack_using_command buildcache install' -s o -l otherarch -d 'install specs from other architectures instead of default platform and OS'
# spack buildcache list
-set -g __fish_spack_optspecs_spack_buildcache_list h/help l/long L/very-long v/variants a/allarch
+set -g __fish_spack_optspecs_spack_buildcache_list h/help l/long L/very-long N/namespaces v/variants a/allarch
complete -c spack -n '__fish_spack_using_command_pos_remainder 0 buildcache list' -f -k -a '(__fish_spack_specs)'
complete -c spack -n '__fish_spack_using_command buildcache list' -s h -l help -f -a help
complete -c spack -n '__fish_spack_using_command buildcache list' -s h -l help -d 'show this help message and exit'
@@ -747,6 +747,8 @@ complete -c spack -n '__fish_spack_using_command buildcache list' -s l -l long -
complete -c spack -n '__fish_spack_using_command buildcache list' -s l -l long -d 'show dependency hashes as well as versions'
complete -c spack -n '__fish_spack_using_command buildcache list' -s L -l very-long -f -a very_long
complete -c spack -n '__fish_spack_using_command buildcache list' -s L -l very-long -d 'show full dependency hashes as well as versions'
+complete -c spack -n '__fish_spack_using_command buildcache list' -s N -l namespaces -f -a namespaces
+complete -c spack -n '__fish_spack_using_command buildcache list' -s N -l namespaces -d 'show fully qualified package names'
complete -c spack -n '__fish_spack_using_command buildcache list' -s v -l variants -f -a variants
complete -c spack -n '__fish_spack_using_command buildcache list' -s v -l variants -d 'show variants in output (can be long)'
complete -c spack -n '__fish_spack_using_command buildcache list' -s a -l allarch -f -a allarch
@@ -1592,7 +1594,7 @@ complete -c spack -n '__fish_spack_using_command fetch' -s D -l dependencies -f
complete -c spack -n '__fish_spack_using_command fetch' -s D -l dependencies -d 'also fetch all dependencies'
# spack find
-set -g __fish_spack_optspecs_spack_find h/help format= H/hashes json d/deps p/paths groups no-groups l/long L/very-long t/tag= c/show-concretized f/show-flags show-full-compiler x/explicit X/implicit u/unknown m/missing v/variants loaded M/only-missing deprecated only-deprecated N/namespace start-date= end-date=
+set -g __fish_spack_optspecs_spack_find h/help format= H/hashes json d/deps p/paths groups no-groups l/long L/very-long t/tag= N/namespaces c/show-concretized f/show-flags show-full-compiler x/explicit X/implicit u/unknown m/missing v/variants loaded M/only-missing deprecated only-deprecated start-date= end-date=
complete -c spack -n '__fish_spack_using_command_pos_remainder 0 find' -f -a '(__fish_spack_installed_specs)'
complete -c spack -n '__fish_spack_using_command find' -s h -l help -f -a help
complete -c spack -n '__fish_spack_using_command find' -s h -l help -d 'show this help message and exit'
@@ -1616,6 +1618,8 @@ complete -c spack -n '__fish_spack_using_command find' -s L -l very-long -f -a v
complete -c spack -n '__fish_spack_using_command find' -s L -l very-long -d 'show full dependency hashes as well as versions'
complete -c spack -n '__fish_spack_using_command find' -s t -l tag -r -f -a tags
complete -c spack -n '__fish_spack_using_command find' -s t -l tag -r -d 'filter a package query by tag (multiple use allowed)'
+complete -c spack -n '__fish_spack_using_command find' -s N -l namespaces -f -a namespaces
+complete -c spack -n '__fish_spack_using_command find' -s N -l namespaces -d 'show fully qualified package names'
complete -c spack -n '__fish_spack_using_command find' -s c -l show-concretized -f -a show_concretized
complete -c spack -n '__fish_spack_using_command find' -s c -l show-concretized -d 'show concretized specs in an environment'
complete -c spack -n '__fish_spack_using_command find' -s f -l show-flags -f -a show_flags
@@ -1640,8 +1644,6 @@ complete -c spack -n '__fish_spack_using_command find' -l deprecated -f -a depre
complete -c spack -n '__fish_spack_using_command find' -l deprecated -d 'show deprecated packages as well as installed specs'
complete -c spack -n '__fish_spack_using_command find' -l only-deprecated -f -a only_deprecated
complete -c spack -n '__fish_spack_using_command find' -l only-deprecated -d 'show only deprecated packages'
-complete -c spack -n '__fish_spack_using_command find' -s N -l namespace -f -a namespace
-complete -c spack -n '__fish_spack_using_command find' -s N -l namespace -d 'show fully qualified package names'
complete -c spack -n '__fish_spack_using_command find' -l start-date -r -f -a start_date
complete -c spack -n '__fish_spack_using_command find' -l start-date -r -d 'earliest date of installation [YYYY-MM-DD]'
complete -c spack -n '__fish_spack_using_command find' -l end-date -r -f -a end_date
@@ -2526,7 +2528,7 @@ complete -c spack -n '__fish_spack_using_command restage' -s h -l help -f -a hel
complete -c spack -n '__fish_spack_using_command restage' -s h -l help -d 'show this help message and exit'
# spack solve
-set -g __fish_spack_optspecs_spack_solve h/help show= l/long L/very-long I/install-status no-install-status y/yaml j/json c/cover= N/namespaces t/types timers stats U/fresh reuse reuse-deps
+set -g __fish_spack_optspecs_spack_solve h/help show= l/long L/very-long N/namespaces I/install-status no-install-status y/yaml j/json c/cover= t/types timers stats U/fresh reuse reuse-deps
complete -c spack -n '__fish_spack_using_command_pos_remainder 0 solve' -f -k -a '(__fish_spack_specs_or_id)'
complete -c spack -n '__fish_spack_using_command solve' -s h -l help -f -a help
complete -c spack -n '__fish_spack_using_command solve' -s h -l help -d 'show this help message and exit'
@@ -2536,6 +2538,8 @@ complete -c spack -n '__fish_spack_using_command solve' -s l -l long -f -a long
complete -c spack -n '__fish_spack_using_command solve' -s l -l long -d 'show dependency hashes as well as versions'
complete -c spack -n '__fish_spack_using_command solve' -s L -l very-long -f -a very_long
complete -c spack -n '__fish_spack_using_command solve' -s L -l very-long -d 'show full dependency hashes as well as versions'
+complete -c spack -n '__fish_spack_using_command solve' -s N -l namespaces -f -a namespaces
+complete -c spack -n '__fish_spack_using_command solve' -s N -l namespaces -d 'show fully qualified package names'
complete -c spack -n '__fish_spack_using_command solve' -s I -l install-status -f -a install_status
complete -c spack -n '__fish_spack_using_command solve' -s I -l install-status -d 'show install status of packages'
complete -c spack -n '__fish_spack_using_command solve' -l no-install-status -f -a install_status
@@ -2546,8 +2550,6 @@ complete -c spack -n '__fish_spack_using_command solve' -s j -l json -f -a forma
complete -c spack -n '__fish_spack_using_command solve' -s j -l json -d 'print concrete spec as json'
complete -c spack -n '__fish_spack_using_command solve' -s c -l cover -r -f -a 'nodes edges paths'
complete -c spack -n '__fish_spack_using_command solve' -s c -l cover -r -d 'how extensively to traverse the DAG (default: nodes)'
-complete -c spack -n '__fish_spack_using_command solve' -s N -l namespaces -f -a namespaces
-complete -c spack -n '__fish_spack_using_command solve' -s N -l namespaces -d 'show fully qualified package names'
complete -c spack -n '__fish_spack_using_command solve' -s t -l types -f -a types
complete -c spack -n '__fish_spack_using_command solve' -s t -l types -d 'show dependency types'
complete -c spack -n '__fish_spack_using_command solve' -l timers -f -a timers
@@ -2562,7 +2564,7 @@ complete -c spack -n '__fish_spack_using_command solve' -l reuse-deps -f -a conc
complete -c spack -n '__fish_spack_using_command solve' -l reuse-deps -d 'reuse installed dependencies only'
# spack spec
-set -g __fish_spack_optspecs_spack_spec h/help l/long L/very-long I/install-status no-install-status y/yaml j/json format= c/cover= N/namespaces t/types U/fresh reuse reuse-deps
+set -g __fish_spack_optspecs_spack_spec h/help l/long L/very-long N/namespaces I/install-status no-install-status y/yaml j/json format= c/cover= t/types U/fresh reuse reuse-deps
complete -c spack -n '__fish_spack_using_command_pos_remainder 0 spec' -f -k -a '(__fish_spack_specs_or_id)'
complete -c spack -n '__fish_spack_using_command spec' -s h -l help -f -a help
complete -c spack -n '__fish_spack_using_command spec' -s h -l help -d 'show this help message and exit'
@@ -2570,6 +2572,8 @@ complete -c spack -n '__fish_spack_using_command spec' -s l -l long -f -a long
complete -c spack -n '__fish_spack_using_command spec' -s l -l long -d 'show dependency hashes as well as versions'
complete -c spack -n '__fish_spack_using_command spec' -s L -l very-long -f -a very_long
complete -c spack -n '__fish_spack_using_command spec' -s L -l very-long -d 'show full dependency hashes as well as versions'
+complete -c spack -n '__fish_spack_using_command spec' -s N -l namespaces -f -a namespaces
+complete -c spack -n '__fish_spack_using_command spec' -s N -l namespaces -d 'show fully qualified package names'
complete -c spack -n '__fish_spack_using_command spec' -s I -l install-status -f -a install_status
complete -c spack -n '__fish_spack_using_command spec' -s I -l install-status -d 'show install status of packages'
complete -c spack -n '__fish_spack_using_command spec' -l no-install-status -f -a install_status
@@ -2582,8 +2586,6 @@ complete -c spack -n '__fish_spack_using_command spec' -l format -r -f -a format
complete -c spack -n '__fish_spack_using_command spec' -l format -r -d 'print concrete spec with the specified format string'
complete -c spack -n '__fish_spack_using_command spec' -s c -l cover -r -f -a 'nodes edges paths'
complete -c spack -n '__fish_spack_using_command spec' -s c -l cover -r -d 'how extensively to traverse the DAG (default: nodes)'
-complete -c spack -n '__fish_spack_using_command spec' -s N -l namespaces -f -a namespaces
-complete -c spack -n '__fish_spack_using_command spec' -s N -l namespaces -d 'show fully qualified package names'
complete -c spack -n '__fish_spack_using_command spec' -s t -l types -f -a types
complete -c spack -n '__fish_spack_using_command spec' -s t -l types -d 'show dependency types'
complete -c spack -n '__fish_spack_using_command spec' -s U -l fresh -f -a concretizer_reuse