summaryrefslogtreecommitdiff
path: root/provides/zsh/completions
diff options
context:
space:
mode:
Diffstat (limited to 'provides/zsh/completions')
-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