Skip to content

Commit

Permalink
Add zsh autocompletion for khal import.
Browse files Browse the repository at this point in the history
  • Loading branch information
Hugo Osvaldo Barrera committed Jun 22, 2015
1 parent 514a5b1 commit 7183ffe
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion misc/__khal
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ _calendars() {
compadd "$a" ${(kv)=accounts}
}

_ics_files() {
_files -g "*.ics"
}

local ret=1 state

Expand Down Expand Up @@ -39,6 +42,7 @@ case $state in
"agenda:show agenda"
"calendar:show calendar"
"interactive:open the interactive calendar"
"import:import an ics file into a calendar"
"new:add a new event"
"printcalendars:print all configured calendars"
"printformats:print a date in all formats"
Expand All @@ -61,7 +65,12 @@ case $state in
"-b=[do not use this calendar]:calendars:_calendars"
)
;;

import)
args+=(
"-a=[use this calendar]:calendars:_calendars"
"*:file:_ics_files"
)
;;
esac

_arguments $args && ret=0
Expand Down

0 comments on commit 7183ffe

Please sign in to comment.