summaryrefslogtreecommitdiff
path: root/provides/zsh/completions/_efa
diff options
context:
space:
mode:
authorDaniel Friesel <derf@derf.homelinux.org>2009-05-20 19:27:32 +0200
committerDaniel Friesel <derf@derf.homelinux.org>2009-05-20 19:27:32 +0200
commit5ccbdc9d31d6c384f7630f745799113761fbefd0 (patch)
tree06f2879efd2acc4f2899624b9491c61b59bcaf37 /provides/zsh/completions/_efa
parent0fd9e8a907d79c82d58dd34d031db20462aed115 (diff)
efa: Added --exclude ("ausgewählte Verkehrsmittel")
Diffstat (limited to 'provides/zsh/completions/_efa')
-rw-r--r--provides/zsh/completions/_efa13
1 files changed, 13 insertions, 0 deletions
diff --git a/provides/zsh/completions/_efa b/provides/zsh/completions/_efa
index 92f3bad..568e572 100644
--- a/provides/zsh/completions/_efa
+++ b/provides/zsh/completions/_efa
@@ -10,6 +10,7 @@ arguments=(
'(--depart --time)--arrive:time'
'(--arrive --time)--depart:time'
'--date:date'
+ '*--exclude:transports:_efa_transports'
'--max-change:number'
'--prefer:type:(speed nowait nowalk)'
'--proximity'
@@ -18,4 +19,16 @@ arguments=(
'*--post:POST key=value'
)
+function _efa_transports {
+ typeset -a keys used_prefixes
+ typeset prefix=''
+ keys=(zug s-bahn u-bahn stadtbahn tram stadtbus regionalbus schnellbus seilbahn schiff ast sonstige)
+
+ if [[ -prefix *, ]] {
+ prefix=${words[$CURRENT]%,*},
+ used_prefixes=(${(s:,:)prefix})
+ }
+ _wanted expression expl 'sort expression' \
+ compadd -F used_prefixes -qS , -P "$prefix" $keys
+}
_arguments -s $arguments