Parent directory

_cpanm

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