Skip to content

Commit

Permalink
bash completion: fixed invalid identifier (spack#4079)
Browse files Browse the repository at this point in the history
* 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`.
  • Loading branch information
alalazo authored and adamjstewart committed May 3, 2017
1 parent 7ef46f4 commit 060351e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion share/spack/spack-completion.bash
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -288,7 +291,7 @@ function _spack_debug {
fi
}

function _spack_create-db-tarball {
function _spack_debug_create_db_tarball {
compgen -W "-h --help" -- "$cur"
}

Expand Down

0 comments on commit 060351e

Please sign in to comment.