_port 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  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