summaryrefslogtreecommitdiff
path: root/share
diff options
context:
space:
mode:
Diffstat (limited to 'share')
-rwxr-xr-xshare/spack/qa/completion-test.sh3
-rwxr-xr-xshare/spack/spack-completion.bash11
2 files changed, 12 insertions, 2 deletions
diff --git a/share/spack/qa/completion-test.sh b/share/spack/qa/completion-test.sh
index 95564e2315..e648a2ba77 100755
--- a/share/spack/qa/completion-test.sh
+++ b/share/spack/qa/completion-test.sh
@@ -42,7 +42,8 @@ do
succeeds _spack_completions "${line[@]}" ''
# Test that completion with flags works
- contains '-h --help' _spack_completions "${line[@]}" -
+ # all commands but spack pkg grep have -h; all have --help
+ contains '--help' _spack_completions "${line[@]}" -
done <<- EOF
$(spack commands --aliases --format=subcommands)
EOF
diff --git a/share/spack/spack-completion.bash b/share/spack/spack-completion.bash
index 5c90b1b5f3..604468aaeb 100755
--- a/share/spack/spack-completion.bash
+++ b/share/spack/spack-completion.bash
@@ -1450,7 +1450,7 @@ _spack_pkg() {
then
SPACK_COMPREPLY="-h --help"
else
- SPACK_COMPREPLY="add list diff added changed removed source hash"
+ SPACK_COMPREPLY="add list diff added changed removed grep source hash"
fi
}
@@ -1508,6 +1508,15 @@ _spack_pkg_removed() {
fi
}
+_spack_pkg_grep() {
+ if $list_options
+ then
+ SPACK_COMPREPLY="--help"
+ else
+ SPACK_COMPREPLY=""
+ fi
+}
+
_spack_pkg_source() {
if $list_options
then