#compdef vov
#
# https://github.com/thrig/sial.org-scripts/tree/master/ly-fu

local curcontext="$curcontext" state line
typeset -A opt_args

# XXX simplistic, really should feed to a case then figure out where in
# numeral cursor is, what to offer from there, including b# prefix or **
# or the like suffixes.
local -a numerals
numerals=(I II III IV V VI VII i ii iii iv v vi vii)

# transpose can take numbers, but simplier to just show possible notes
_arguments \
  '--factor=[default chord factor]:factor:(1 3 5 7 9 11 13)' \
  '(--noflats)--flats[print notes as flats]' \
  '(--flats)--noflats[print notes not as flats]' \
  '(- *)--listmodes[show available modes]' \
  '(--mode --minor)--minor[minor mode]' \
  '(--mode --minor)--mode=[musical mode]:mode:->modes' \
  '--natural[ignore case distinctions of input numerals]' \
  '--outputtmpl=[custom output template]:template:' \
  '--raw[show pitch numbers not note names]' \
  '--transpose=[transpose by or to]:noteornum:(a b d e f g cis dis fis gis ais des ees ges aes bes)' \
  '*: :_values -s / "numerals" $numerals' \
  && return 0

case "$state" in
  modes)
    _wanted mode expl 'mode' compadd $(_call_program mode vov --listmodes)
  ;;
esac
