/usr/share/zsh/vendor-completions/_khal is in khal 1:0.9.8-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 | #compdef khal
# install by copying to file where your zsh looks for completion scripts
# e.g. add this to your zshrc:
# fpath=(~/.zsh/completion $fpath)
_calendars() {
local expl
_wanted calendars expl calendar compadd \
${(f)"$(_call_program calendars khal printcalendars)"}
}
local curcontext="$curcontext" hlp="--help" ret=1
local -a args state line
local -A opt_args
args=( '(- *)--help[show help information]' )
_arguments -C $args \
{-c+,--config=}'[specify config file]:config file:_files' \
{-v,--verbose}"[give more output]" \
'(- *)--version[show version]' \
':subcommand:->subcommand' \
'*::options:->options' && ret=0
case $state in
subcommand)
local -a subcommands
subcommands=(
'at:show all events for given time'
"calendar:show calendar"
"configure: intitial configuration"
"edit:edit (or delete) an event"
"import:import an ics file into a calendar"
"interactive:open the interactive calendar"
"list:show list of events"
"new:add a new event"
"printcalendars:print all configured calendars"
"printformats:print a date in all formats"
"printics:print ics file without importing"
"search:search for events"
)
_describe -t subcommands 'khal subcommands' subcommands && ret=0
;;
options)
curcontext="${curcontext%:*}-${words[1]}:"
case $words[1] in
at | calendar | list | interactive | search | printcalendars | edit)
args+=(
"(-d --exclude-calendar $hlp)*"{-a+,--include-calendar=}'[specify calendar to use]:calendar:_calendars'
"(-a --include-calendar $hlp)*"{-d+,--exclude-calendar=}"[don't use this calendar]:calendar:_calendars"
)
;|
list | calendar)
args+=(
"($hlp)--days=[specify how many days to include]:days:_dates -f d -F"
"($hlp)--events=[specify how many events to include]:events"
)
;|
at | list) args+=( '*:date/time' ) ;;
new | import)
args+=(
"($hlp)-a+[specify calendar]:calendar:_calendars"
)
;|
import)
args+=(
"(-r --random_uid $hlp)"{-r,--random_uid}'[select a random uid]'
"($hlp)--batch[don't ask for any confirmation]"
'*:file:_files -g "*.ics(-.)"'
)
;;
new)
args+=(
"(-l --location $hlp)"{-l,--location=}'[specify location of event]:location'
"(-r --repeat $hlp)"{-r,--repeat=}'[repeat an event]:frequency:compadd -E0 - daily weekly monthly yearly'
"(-u --until $hlp)"{-u,--until=}'[specify date to stop an event repeating]:date'
"(-i --interactive $hlp)"{-i,--interactive=}'[interactively create a new event]'
':start date/time' '::end date/time' '::timezone' ':summary' ':description'
)
;;
esac
_arguments -A "-*" $args && ret=0
;;
esac
return ret
|