diff options
author | Tanaka Akira <akr@users.sourceforge.net> | 2000-03-13 01:49:35 +0000 |
---|---|---|
committer | Tanaka Akira <akr@users.sourceforge.net> | 2000-03-13 01:49:35 +0000 |
commit | 766f8691e60c9e1f0b4a24b0a639ccbe0489ec47 (patch) | |
tree | e9fa850e7651d497bf678dd160234b4f940f852f /Completion/User/_perl_modules | |
parent | be0a1ed15ddcb54c167b3419ff47656111f4caa1 (diff) | |
download | zsh-766f8691e60c9e1f0b4a24b0a639ccbe0489ec47.tar.gz zsh-766f8691e60c9e1f0b4a24b0a639ccbe0489ec47.tar.xz zsh-766f8691e60c9e1f0b4a24b0a639ccbe0489ec47.zip |
zsh-workers/10087
Diffstat (limited to 'Completion/User/_perl_modules')
-rw-r--r-- | Completion/User/_perl_modules | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/Completion/User/_perl_modules b/Completion/User/_perl_modules index 272ebb5e4..8f6a5b882 100644 --- a/Completion/User/_perl_modules +++ b/Completion/User/_perl_modules @@ -7,16 +7,22 @@ # Calculate all installed Perl modules. The result is cached # for future use. # +# Available styles: +# +# * try-to-use-pminst +# +# Set this if you have pminst and want to use it. The zsh code +# actually produces better results because pminst misses modules of +# the form Foo/bar/Baz.pm through its clumsy -d && /^[A-Z]/ && prune +# algorithm (the zsh code does almost the same, but only misses +# modules which don't begin with an uppercase letter). -# Change this if you have pminst and want to use it. The zsh code -# actually produces better results because pminst misses modules of -# the form Foo/bar/Baz.pm through its clumsy -d && /^[A-Z]/ && prune -# algorithm (the zsh code does almost the same, but only misses modules -# which don't begin with an uppercase letter). -local try_to_use_pminst=0 +local opts +zparseopts -D -a opts S: q if [[ ${+_perl_modules} -eq 0 ]]; then - if [[ $try_to_use_pminst -ne 0 ]] && which pminst >/dev/null; then + if zstyle -t ":completion:${curcontext}:modules" try-to-use-pminst \ + && which pminst >/dev/null; then _perl_modules=( $(pminst) ) else local inc libdir new_pms @@ -43,4 +49,4 @@ fi local expl -_wanted modules expl 'Perl modules' && compadd "$expl[@]" - $_perl_modules +_wanted modules expl 'Perl modules' && compadd "$expl[@]" "$opts[@]" - $_perl_modules |