1#compdef mencal
2
3local curcontext="$curcontext" state line ret=1
4
5_arguments -C \
6  '(--monday -m)'{-m,--monday}'[monday as first day of work]' \
7  '-1[current month]' \
8  '-3[previous, current, and next month]' \
9  '-y[all-year calendar]::year:' \
10  '(--quiet -q)'{-q,--quiet}'[no top information]' \
11  '(--nocolor -n)'{-n,--nocolor}'[noncolored output]' \
12  '(--icolor -i)'{-i,--icolor}'[intersection color]:color:(red green blue yellow violet cyan shiny bold)' \
13  '(-)'{-h,--help}'[display help information]' \
14  '(-)'{-V,--version}'[print version information]' \
15  \*{-c,--config}'[config]:options:->option' && ret=0
16
17if [[ $state = option ]]; then
18  _values -s , 'config option' \
19    '(s start)'{s,start}'[start day]:day' \
20    '(l length)'{l,length}'[period length]:length' \
21    '(d duration)'{d,duration}'[menstruation duration]:duration' \
22    '(n name)'{n,name}'[name of subject]:name' \
23    '(f file)'{f,file}'[filename]:file:_files' \
24    '(c color)'{c,color}'[color for menstruation days]:color:(red green blue yellow violet cyan shiny bold)' && ret=0
25fi
26
27return ret
28