diff options
author | Todd Gamblin <tgamblin@llnl.gov> | 2020-01-23 14:48:06 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-23 14:48:06 -0800 |
commit | 04a6a55cf8c0539ffe02f38162622a789fb8ad1f (patch) | |
tree | ea54d662e2053e76004a7cd34f6713bec8d9973f /share | |
parent | 031fdfd7ca1df854e4a829ed124f5ce0043c779e (diff) | |
download | spack-04a6a55cf8c0539ffe02f38162622a789fb8ad1f.tar.gz spack-04a6a55cf8c0539ffe02f38162622a789fb8ad1f.tar.bz2 spack-04a6a55cf8c0539ffe02f38162622a789fb8ad1f.tar.xz spack-04a6a55cf8c0539ffe02f38162622a789fb8ad1f.zip |
commands: add simple `spack commands --update-completion` argument (#14607)
Instead of another script, this adds a simple argument to `spack
commands` that updates the completion script. Developers can now just
run:
spack commands --update-completion
This should make it simpler for developers to remember to run this
*before* the tests fail. Also, this version tab-completes.
Diffstat (limited to 'share')
-rwxr-xr-x | share/spack/qa/update-completion-scripts.sh | 23 | ||||
-rwxr-xr-x | share/spack/spack-completion.bash | 2 |
2 files changed, 1 insertions, 24 deletions
diff --git a/share/spack/qa/update-completion-scripts.sh b/share/spack/qa/update-completion-scripts.sh deleted file mode 100755 index 8fcd321457..0000000000 --- a/share/spack/qa/update-completion-scripts.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/usr/bin/env bash -# -# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other -# Spack Project Developers. See the top-level COPYRIGHT file for details. -# -# SPDX-License-Identifier: (Apache-2.0 OR MIT) - -# Updates Spack's shell tab completion scripts - -# Switch to parent directory -QA_DIR="$(dirname "${BASH_SOURCE[0]}")" -cd "$QA_DIR/.." - -# Update each shell -for shell in bash # zsh fish -do - header=$shell/spack-completion.in - script=spack-completion.$shell - - rm -f $script - spack commands --aliases --format=$shell --header=$header --update=$script - chmod +x $script -done diff --git a/share/spack/spack-completion.bash b/share/spack/spack-completion.bash index 79dcf8e559..9550137bff 100755 --- a/share/spack/spack-completion.bash +++ b/share/spack/spack-completion.bash @@ -507,7 +507,7 @@ _spack_clone() { _spack_commands() { if $list_options then - SPACK_COMPREPLY="-h --help -a --aliases --format --header --update" + SPACK_COMPREPLY="-h --help --update-completion -a --aliases --format --header --update" else SPACK_COMPREPLY="" fi |