From 9e335ae7dc4b0e71be53abf796670d8508c485af Mon Sep 17 00:00:00 2001 From: Jesse Keating Date: Wed, 8 Sep 2010 16:32:52 -0700 Subject: bash-completion < 1.2 compatibility (tmz@pobox.com) The _get_comp_words_by_ref is provided by bash-completion >= 1.2, which EL-5 lacks. Attempting to use fedpkg completion on EL-5 results in errors: $ fedpkg -bash: _get_comp_words_by_ref: command not found Fall back to using ${COMP_WORDS[COMP_CWORD]}. --- src/fedpkg.bash | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/fedpkg.bash') diff --git a/src/fedpkg.bash b/src/fedpkg.bash index 7544144..8ea8a66 100644 --- a/src/fedpkg.bash +++ b/src/fedpkg.bash @@ -15,7 +15,14 @@ _fedpkg() } local cur prev - _get_comp_words_by_ref cur prev + # _get_comp_words_by_ref is in bash-completion >= 1.2, which EL-5 lacks. + if type _get_comp_words_by_ref &>/dev/null; then + _get_comp_words_by_ref cur prev + else + cur="${COMP_WORDS[COMP_CWORD]}" + prev="${COMP_WORDS[COMP_CWORD-1]}" + fi + local paths_exclude="@(.git|*/.git)" -- cgit