#compdef portupgrade

_arguments -s \
 '-h[show help]' \
 '-a[all packages]' \
 '-A:command to run after each installation:' \
 '-B:command to run before each build:' \
 '-c[clean before build]' \
 '-C[clean after install]' \
 '-f[force upgrade]' \
 '-F[fetch only]' \
 '-i[be interactive]' \
 '-m:make(1) args:' \
 '-n[no execute]' \
 '-o:origin:_files -W /usr/ports -/' \
 '-p[make package]' \
 '-P[use packages (specified twice, use packages only)]' \
 '-R[do upward recursively]' \
 '-r[do recursively]' \
 '-s[run commands under sudo(8) where needed]' \
 '-S:the alternative to sudo(8):' \
 '-u[uninstall before install]' \
 '-v[be verbose]' \
 '-x:exclude pattern:compadd - /var/db/pkg/*(\:t)' \
 '*:package to upgrade:compadd - /var/db/pkg/*(\:t)'
