summaryrefslogtreecommitdiff
path: root/share
diff options
context:
space:
mode:
authorMassimiliano Culpo <massimiliano.culpo@googlemail.com>2017-05-03 15:12:33 +0200
committerAdam J. Stewart <ajstewart426@gmail.com>2017-05-03 08:12:33 -0500
commit060351e121b3ae1a7056435d760d7724f5674699 (patch)
tree1168035d4d04eab761bfc9e5f1ccdd13e771a4de /share
parent7ef46f4f6930897ea2c020da0815c0faea992805 (diff)
downloadspack-060351e121b3ae1a7056435d760d7724f5674699.tar.gz
spack-060351e121b3ae1a7056435d760d7724f5674699.tar.bz2
spack-060351e121b3ae1a7056435d760d7724f5674699.tar.xz
spack-060351e121b3ae1a7056435d760d7724f5674699.zip
bash completion: fixed invalid identifier (#4079)
* bash completion: fixed `_spack_create-db-tarball': not a valid identifier * bash completion: dashes are translated to underscores This also fixes the name of the subfunction to be called, as apparently it was not updated after moving the command `create-db-tarball`.
Diffstat (limited to 'share')
-rwxr-xr-xshare/spack/spack-completion.bash5
1 files changed, 4 insertions, 1 deletions
diff --git a/share/spack/spack-completion.bash b/share/spack/spack-completion.bash
index 819dcc06ab..b8d104aca8 100755
--- a/share/spack/spack-completion.bash
+++ b/share/spack/spack-completion.bash
@@ -53,6 +53,9 @@ function _bash_completion_spack {
# For example, `spack -d install []` will call _spack_install
# and `spack compiler add []` will call _spack_compiler_add
local subfunction=$(IFS='_'; echo "_${COMP_WORDS_NO_FLAGS[*]}")
+ # Translate dashes to underscores, as dashes are not permitted in
+ # compatibility mode. See https://github.com/LLNL/spack/pull/4079
+ subfunction=${subfunction//-/_}
# However, the word containing the current cursor position needs to be
# added regardless of whether or not it is a flag. This allows us to
@@ -288,7 +291,7 @@ function _spack_debug {
fi
}
-function _spack_create-db-tarball {
+function _spack_debug_create_db_tarball {
compgen -W "-h --help" -- "$cur"
}