From 5d50ad3941ebeee95d972baff265e31be22a380a Mon Sep 17 00:00:00 2001 From: Peter Scheibel Date: Tue, 19 Dec 2023 16:37:44 -0800 Subject: "spack diff": add ignore option for dependencies (#41711) * add trim function to `Spec` and `--ignore` option to 'spack diff' Allows user to compare two specs while ignoring the sub-DAG of a particular dependency, e.g. spack diff --ignore=mpi --ignore=zlib trilinos/abcdef trilinos/fedcba to focus on differences closer to the root of the software stack --- share/spack/spack-completion.bash | 2 +- share/spack/spack-completion.fish | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'share') diff --git a/share/spack/spack-completion.bash b/share/spack/spack-completion.bash index 85358fbdcc..6ebba8e1ee 100755 --- a/share/spack/spack-completion.bash +++ b/share/spack/spack-completion.bash @@ -999,7 +999,7 @@ _spack_develop() { _spack_diff() { if $list_options then - SPACK_COMPREPLY="-h --help --json --first -a --attribute" + SPACK_COMPREPLY="-h --help --json --first -a --attribute --ignore" else _all_packages fi diff --git a/share/spack/spack-completion.fish b/share/spack/spack-completion.fish index a05cb6c658..cce1622217 100755 --- a/share/spack/spack-completion.fish +++ b/share/spack/spack-completion.fish @@ -1405,7 +1405,7 @@ complete -c spack -n '__fish_spack_using_command develop' -s f -l force -r -f -a complete -c spack -n '__fish_spack_using_command develop' -s f -l force -r -d 'remove any files or directories that block cloning source code' # spack diff -set -g __fish_spack_optspecs_spack_diff h/help json first a/attribute= +set -g __fish_spack_optspecs_spack_diff h/help json first a/attribute= ignore= complete -c spack -n '__fish_spack_using_command_pos_remainder 0 diff' -f -a '(__fish_spack_installed_specs)' complete -c spack -n '__fish_spack_using_command diff' -s h -l help -f -a help complete -c spack -n '__fish_spack_using_command diff' -s h -l help -d 'show this help message and exit' @@ -1415,6 +1415,8 @@ complete -c spack -n '__fish_spack_using_command diff' -l first -f -a load_first complete -c spack -n '__fish_spack_using_command diff' -l first -d 'load the first match if multiple packages match the spec' complete -c spack -n '__fish_spack_using_command diff' -s a -l attribute -r -f -a attribute complete -c spack -n '__fish_spack_using_command diff' -s a -l attribute -r -d 'select the attributes to show (defaults to all)' +complete -c spack -n '__fish_spack_using_command diff' -l ignore -r -f -a ignore +complete -c spack -n '__fish_spack_using_command diff' -l ignore -r -d 'omit diffs related to these dependencies' # spack docs set -g __fish_spack_optspecs_spack_docs h/help -- cgit v1.2.3-60-g2f50