_port 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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. 'rpmpackage'
  42. 'search'
  43. 'selfupdate'
  44. 'sync'
  45. 'test'
  46. 'unarchive'
  47. 'uninstall'
  48. 'upgrade'
  49. 'variants'
  50. 'version'
  51. )
  52. _arguments -C \
  53. '-v[verbose mode (generate verbose messages)]' \
  54. '-d[debug mode (generate debugging messages)]' \
  55. '-q[quiet mode (suppress messages)]' \
  56. '-D[specify portdir]' \
  57. '-k[keep mode (do not autoclean after install)]' \
  58. '-n[dont follow dependencies in upgrade (only for upgrading)]' \
  59. '-a[upgrade all installed ports (only for upgrading)]' \
  60. '-u[uninstall non-active ports when upgrading and uninstalling]' \
  61. '-f[force mode (ignore state file)]' \
  62. '-s[source-only mode]' \
  63. '-b[binary-only mode]' \
  64. '-o[honor state files older than Portfile]' \
  65. '*::command:->command' \
  66. && return 0
  67. case $state in
  68. command)
  69. if ((CURRENT == 1)); then
  70. state=subcommands
  71. else
  72. state=portname
  73. fi
  74. ;;
  75. esac
  76. case $state in
  77. subcommands)
  78. _describe -t commands 'port commands' subcmds
  79. ;;
  80. portname)
  81. _describe -t commands 'available ports' portlist
  82. ;;
  83. esac