_port 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. #compdef port
  2. local subcmds
  3. # we cache the list of ports
  4. # we shall use some cache policy to avoid problems with new ports
  5. if (( ! $+portlist )); then
  6. portlist=($(port echo all; echo "all current active inactive installed uninstalled outdated"))
  7. fi
  8. subcmds=(
  9. 'activate'
  10. 'archive'
  11. 'build'
  12. 'cat'
  13. 'clean'
  14. 'configure'
  15. 'contents'
  16. 'deactivate'
  17. 'dependents'
  18. 'deps'
  19. 'destroot'
  20. 'dir'
  21. 'distcheck'
  22. 'distclean'
  23. 'dmg'
  24. 'echo'
  25. 'edit'
  26. 'extract'
  27. 'fetch'
  28. 'file'
  29. 'help'
  30. 'info'
  31. 'install'
  32. 'installed'
  33. 'list'
  34. 'livecheck'
  35. 'location'
  36. 'mpkg'
  37. 'outdated'
  38. 'patch'
  39. 'pkg'
  40. 'provides'
  41. 'rdependents'
  42. 'rdeps'
  43. 'rpmpackage'
  44. 'search'
  45. 'selfupdate'
  46. 'sync'
  47. 'test'
  48. 'unarchive'
  49. 'uninstall'
  50. 'upgrade'
  51. 'variants'
  52. 'version'
  53. )
  54. _arguments -C \
  55. '-v[verbose mode (generate verbose messages)]' \
  56. '-d[debug mode (generate debugging messages)]' \
  57. '-q[quiet mode (suppress messages)]' \
  58. '-D[specify portdir]' \
  59. '-k[keep mode (do not autoclean after install)]' \
  60. '-n[dont follow dependencies in upgrade (only for upgrading)]' \
  61. '-a[upgrade all installed ports (only for upgrading)]' \
  62. '-u[uninstall non-active ports when upgrading and uninstalling]' \
  63. '-f[force mode (ignore state file)]' \
  64. '-s[source-only mode]' \
  65. '-b[binary-only mode]' \
  66. '-o[honor state files older than Portfile]' \
  67. '*::command:->command' \
  68. && return 0
  69. case $state in
  70. command)
  71. if ((CURRENT == 1)); then
  72. state=subcommands
  73. else
  74. state=portname
  75. fi
  76. ;;
  77. esac
  78. case $state in
  79. subcommands)
  80. _describe -t commands 'port commands' subcmds
  81. ;;
  82. portname)
  83. _describe -t commands 'available ports' portlist
  84. ;;
  85. esac