_aptitude 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. #compdef aptitude
  2. local curcontext="$curcontext" state line cmds ret=1
  3. _arguments -C \
  4. '(- 1 *)'{-h,--help}'[display help information]' \
  5. '(- 1 *)--version[display version information]' \
  6. '(-s --simulate)'{-s,--simulate}'[print actions without performing them]' \
  7. '(-d --download-only)'{-d,--download-only}"[just download packages - don't install]" \
  8. '(-P --prompt)'{-P,--prompt}'[always display a prompt]' \
  9. '(-y --assume-yes)'{-y,--assume-yes}'[assume yes answer to questions]' \
  10. '(-F --display-format)'{-F,--display-format}'[specify output format for search command]:format' \
  11. '(-O --sort)'{-O,--sort}'[specify sort order]:sort order:()' \
  12. '(-w --width)'{-w,--width}'[specify output width]:width' \
  13. '-f[aggressivley try to fix dependencies of broken packages]' \
  14. '(-V --show-versions)'{-V,--show-versions}'[show which versions of packages will be installed]' \
  15. '(-D --show-deps)'{-D,--show-deps}'[show brief explanations of automatic installations and removals]' \
  16. '-Z[show disk space changes for each package]' \
  17. '(-v --verbose)'{-v,--verbose}'[causes some commands to display extra information]' \
  18. '(--without-recommends)--with-recommends[install recommended packages when installing new packages]' \
  19. '(--without-suggests)--with-suggests[install suggested packages when installing new packages]' \
  20. '(--with-recommends)--without-recommends[ignore recommended packages when installing new packages]' \
  21. '(--with-suggests)--without-suggests[ignore suggested packages when installing new packages]' \
  22. '1: :->cmds' \
  23. '*: :->args' && ret=0
  24. case $state in
  25. cmds)
  26. cmds=( ${${(M)${(f)"$(LC_ALL=C _call_program commands aptitude -h 2>/dev/null)"}:#* - *}/(#b) (*[^ ]) #- (*)/$match[1]:$match[2]:l})
  27. _describe -t commands 'aptitude command' cmds && ret=0
  28. ;;
  29. args)
  30. case $line[1] in
  31. search)
  32. _message -e patterns pattern
  33. ;;
  34. download|show)
  35. _deb_packages avail && ret=0
  36. ;;
  37. remove|purge|hold)
  38. _deb_packages installed && ret=0
  39. ;;
  40. install|markauto|unmarkauto)
  41. _deb_packages uninstalled && ret=0
  42. ;;
  43. *)
  44. (( ret )) && _message 'no more arguments'
  45. ;;
  46. esac
  47. ;;
  48. esac
  49. return ret