_cpanm 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. #compdef cpanm
  2. ##
  3. # cpanminus Z Shell completion script
  4. ##
  5. #
  6. # Current supported cpanm version: 1.4000 (Tue Mar 8 01:00:49 PST 2011)
  7. #
  8. local arguments curcontext="$curcontext"
  9. typeset -A opt_args
  10. arguments=(
  11. # Commands
  12. # '(--install -i)'{--install,-i}'[Installs the modules]'
  13. '(- :)--self-upgrade[Upgrades itself]'
  14. '(- :)--info[Displays distribution info on CPAN]'
  15. '(--installdeps)--installdeps[Only install dependencies]'
  16. '(--look)--look[Download/unpack the distribution and then open the directory with your shell]'
  17. '(- :)'{--help,-h}'[Displays help information]'
  18. '(- :)'{--version,-V}'[Displays software version]'
  19. # Options
  20. {--force,-f}'[Force install]'
  21. {--notest,-n}'[Do not run unit tests]'
  22. {--sudo,-S}'[sudo to run install commands]'
  23. '(-v --verbose --quiet -q)'{--verbose,-v}'[Turns on chatty output]'
  24. '(-q --quiet --verbose -v)'{--quiet,-q}'[Turns off all output]'
  25. {--local-lib,-l}'[Specify the install base to install modules]'
  26. {--local-lib-contained,-L}'[Specify the install base to install all non-core modules]'
  27. '--mirror[Specify the base URL for the mirror (e.g. http://cpan.cpantesters.org/)]:URLs:_urls'
  28. '--mirror-only[Use the mirror\''s index file instead of the CPAN Meta DB]'
  29. '--prompt[Prompt when configure/build/test fails]'
  30. '--reinstall[Reinstall the distribution even if you already have the latest version installed]'
  31. '--interactive[Turn on interactive configure]'
  32. '--scandeps[Scan the dependencies of given modules and output the tree in a text format]'
  33. '--format[Specify what format to display the scanned dependency tree]:scandeps format:(tree json yaml dists)'
  34. '--save-dists[Specify the optional directory path to copy downloaded tarballs]'
  35. # '--uninst-shadows[Uninstalls the shadow files of the distribution that you\''re installing]'
  36. '--auto-cleanup[Number of days that cpanm\''s work directories expire in. Defaults to 7]'
  37. '(--no-man-pages)--man-pages[Generates man pages for executables (man1) and libraries (man3)]'
  38. '(--man-pages)--no-man-pages[Do not generate man pages]'
  39. # Note: Normally with "--lwp", "--wget" and "--curl" options set to true (which is the default) cpanm tries LWP,
  40. # Wget, cURL and HTTP::Tiny (in that order) and uses the first one available.
  41. # (So that the exclusions are not enabled here for the completion)
  42. '(--lwp)--lwp[Use LWP module to download stuff]'
  43. '(--wget)--wget[Use GNU Wget (if available) to download stuff]'
  44. '(--curl)--curl[Use cURL (if available) to download stuff]'
  45. # Other completions
  46. '*:Local directory or archive:_files -/ -g "*.(tar.gz|tgz|tar.bz2|zip)(-.)"'
  47. # '*::args: _normal' # this looks for default files (any files)
  48. )
  49. _arguments -s $arguments \
  50. && return 0
  51. return 1