From 5ccbdc9d31d6c384f7630f745799113761fbefd0 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Wed, 20 May 2009 19:27:32 +0200 Subject: efa: Added --exclude ("ausgewählte Verkehrsmittel") MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- provides/zsh/completions/_efa | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'provides/zsh/completions/_efa') 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 -- cgit v1.2.3