Skip to content

Instantly share code, notes, and snippets.

@spiritloose
Created September 8, 2009 11:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save spiritloose/182862 to your computer and use it in GitHub Desktop.
Save spiritloose/182862 to your computer and use it in GitHub Desktop.
#compdef cpan
#
# zsh completion code for cpan
# Jiro Nishiguchi <jiro@cpan.org>
#
typeset -A opt_args
local expl context state line
local -a meta_opts
meta_opts="-a -A -C -D -L -h -O -r -v"
_arguments -C -s -S \
'(1 * -)-a[Creates the CPAN.pm autobundle with CPAN::Shell->autobundle.]' \
'(1 * -)-A[Shows the primary maintainers for the specified modules]' \
'(1 * -)-C[Show the "Changes" files for the specified modules]' \
'(1 * -)-D[Show the module details.]' \
'(1 * -)-L[List the modules by the specified authors.]' \
'(1 * -)-h[Prints a help message.]' \
'(1 * -)-O[Show the out-of-date modules.]' \
'(1 * -)-r[Recompiles dynamically loaded modules with CPAN::Shell->recompile.]' \
'(1 * -)-v[Print the script version and CPAN.pm version.]' \
"($meta_opts -i -m -t)-c[Runs a \`make clean\` in the specified module's directories.]" \
"($meta_opts)-f[Forces the specified action, when it normally would have failed.]" \
"($meta_opts -c -m -t)-i[Installed the specified modules.]" \
"($meta_opts -c -i -t)-m[Makes the specified modules.]" \
"($meta_opts -c -i -m)-t[Runs a \`make test\` on the specified modules.]" \
"*:args" \
&& return 0
return 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment