summaryrefslogtreecommitdiffstats
path: root/contrib
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2012-03-28 02:29:48 +0200
committerDan McGee <dan@archlinux.org>2012-03-28 02:29:48 +0200
commitc571bd7afbbe05449558d861a6ec82c559771739 (patch)
tree5ad442cfa60852c468b7611cfc0f13a482970e12 /contrib
parente66edf817b045375645fbd4645eddb15daded4d0 (diff)
downloadpacman-c571bd7afbbe05449558d861a6ec82c559771739.tar.gz
pacman-c571bd7afbbe05449558d861a6ec82c559771739.tar.xz
bash_completion: complete pacman-key options right away
pacman-key requires at least one dashed option, so complete them right away, rather than falling back to default completion. Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'contrib')
-rw-r--r--contrib/bash_completion.in12
1 files changed, 7 insertions, 5 deletions
diff --git a/contrib/bash_completion.in b/contrib/bash_completion.in
index be2406dc..95a27702 100644
--- a/contrib/bash_completion.in
+++ b/contrib/bash_completion.in
@@ -31,12 +31,14 @@ _pacman_key() {
local cur opts prev
COMPREPLY=()
_get_comp_words_by_ref cur prev
- if [[ $cur = -* &&
+ opts=('add delete export finger help list-keys recv-keys updatedb verify
+ version config edit-key gpgdir import import-trustdb init keyserver
+ list-sigs lsign-key populate refresh-keys'
+ 'a d e f h l r u v V')
+ if [[ $prev = 'pacman-key' ]]; then
+ _arch_ptr2comp opts
+ elif [[ $cur = -* &&
$prev != -@(a|-add|c|-config|g|-gpgdir|h|-help|import?(-trustdb)) ]]; then
- opts=('add delete export finger help list-keys recv-keys updatedb verify version
- config edit-key gpgdir import import-trustdb init keyserver list-sigs
- lsign-key populate refresh-keys'
- 'a d e f h l r u v V')
_arch_ptr2comp opts
fi
true