summaryrefslogtreecommitdiffstats
path: root/src/fedpkg.bash
diff options
context:
space:
mode:
authorJesse Keating <jkeating@redhat.com>2010-09-08 16:32:52 -0700
committerJesse Keating <jkeating@redhat.com>2010-09-08 16:32:52 -0700
commit9e335ae7dc4b0e71be53abf796670d8508c485af (patch)
treea36b1529273e1599585f755c6da4a0e8f6157dcb /src/fedpkg.bash
parent658937cded0f763e751bce4f2f60c49199fd14ce (diff)
downloadfedora-packager-9e335ae7dc4b0e71be53abf796670d8508c485af.tar.gz
fedora-packager-9e335ae7dc4b0e71be53abf796670d8508c485af.tar.xz
fedora-packager-9e335ae7dc4b0e71be53abf796670d8508c485af.zip
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 <TAB>-bash: _get_comp_words_by_ref: command not found Fall back to using ${COMP_WORDS[COMP_CWORD]}.
Diffstat (limited to 'src/fedpkg.bash')
-rw-r--r--src/fedpkg.bash9
1 files changed, 8 insertions, 1 deletions
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)"