_port 1.5 KB

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