#compdef portmaster # $FreeBSD$ local context state line array ret=1 typeset -A opt_args _arguments -A "-*" : \ "--force-config['make config' for all ports (overrides -G)]" \ "-C[prevents 'make clean' from being run before building]" \ "-G[prevents 'make config']" \ "-H[hide details of the port build and install in a log file]" \ "-K[prevents 'make clean' from being run after building]" \ "(-b)-B[prevents creation of the backup package for the installed port]" \ "(-B)-b[create and keep a backup package of an installed port]" \ "-g[create a package of the new port]" \ "-n[run through all steps, but do not make or install any ports]" \ "-t[recurse dependencies thoroughly, using all-depends-list]" \ "-v[verbose output]" \ "-w[save old shared libraries before deinstall]" \ "(-i)-f[always rebuild ports (overrides -i)]" \ "(-f)-i[interactive update -- ask whether to rebuild ports]" \ "(-d)-D[no cleaning of distfiles]" \ "(-D)-d[always clean distfiles]" \ "-m[arguments for the 'make' command line]:arguments for make: " \ "-x[avoid building or updating ports that match this pattern]:glob pattern to exclude from building:->pkgs" \ "--no-confirm[do not ask user to confirm list of ports to be installed and/or updated before proceeding]" \ "--no-term-title[do not update the xterm title bar]" \ "--no-index-fetch[skip fetching the INDEX file]" \ "--index[use INDEX exclusively to check if a port is up to date]" \ "--index-first[use the INDEX for status, but double-check with the port]" \ "--index-only[do not try to use /usr/ports]" \ "--delete-build-only[delete ports that are build-only dependencies after a successful run]" \ "--update-if-newer[(only for multiple ports) do not rebuild if installed version is up to date]" \ {-P,--packages}"[use packages, but build port if not available]" \ {-PP,--packages-only}"[fail if no package is available]" \ "--packages-build[use packages for all build dependencies]" \ "--packages-if-newer[use package if newer than installed even if the package is not the latest]" \ "--always-fetch[fetch package even if it already exists locally]" \ "--local-packagedir=-[where local packages can be found]:path:_files -/" \ "--packages-local[use packages from --local-packagedir only]" \ "--delete-packages[after installing from a package, delete it]" \ "-a[check all ports, update as necessary]" \ "--show-work[list what ports are and would be installed]" \ "-o[replace the installed port with a port from a different origin]:new port dir in /usr/ports:->ports" \ "-r[rebuild port, and all ports that depend on it]:name/glob of port in /var/db/pkg:->pkgs" \ "-R[used with -\[rf\] to skip ports updated on a previous run]" \ "-l[list all installed ports by category]" \ "-L[list all installed ports by category, and search for updates]" \ "--list-origins[list directories from /usr/ports for root and leaf ports]" \ "-F[fetch distfiles only]" \ "-e[expunge a port via pkg_delete, and remove its distfiles]:full name of port directory in /var/db/pkg:->pkgs" \ "-s[clean out stale ports that used to be depended on]" \ "--clean-distfiles[offer to delete stale distfiles]" \ "--clean-packages[offer to delete stale packages]" \ "--check-depends[cross-check and update dependency information for all ports]" \ "--check-port-dbdir[check for stale entries in /var/db/ports]" \ "(-h --help)"{-h,--help}"[display help message]" \ "--version[display the version number]" \ '*:Packages and Ports:->pkgs_ports' case "$state" in pkgs) array=("${PKG_DBDIR:-/var/db/pkg}"/*(/:t)) _describe -t packages "installed ports" array ;; ports) _files -X "%Bports%b" -W "${PORTSDIR:-/usr/ports}" -/ ;; pkgs_ports) _tags packages ports while _tags; do if _requested packages; then array=("${PKG_DBDIR:-/var/db/pkg}"/*(/:t)) _describe -t packages "installed ports" array && ret=0 fi if _requested ports; then _files -X "%Bports%b" -W "${PORTSDIR:-/usr/ports}" -/ && ret=0 fi (( ret )) || return ret done ;; esac