mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-09-08 12:01:21 +02:00
32823: complete file instead of Perl script after -
This commit is contained in:
parent
fa4c71b29e
commit
c8e5be9d0f
2 changed files with 18 additions and 1 deletions
|
@ -1,3 +1,8 @@
|
|||
2014-06-30 Peter Stephenson <p.w.stephenson@ntlworld.com>
|
||||
|
||||
* Jun T: 32823: Completion/Unix/Command/_perl: complete file
|
||||
instead of script after -e.
|
||||
|
||||
2014-06-26 Peter Stephenson <p.w.stephenson@ntlworld.com>
|
||||
|
||||
* Jun T: 32812: Doc/zsh.yo, Doc/ztexi.yo: put table of contents
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
# Adam Spiers <adam@spiers.net>
|
||||
#
|
||||
# Completions currently based on Perl 5.14.1.
|
||||
typeset -A opt_args
|
||||
|
||||
_perl () {
|
||||
_arguments -s \
|
||||
|
@ -40,10 +41,21 @@ _perl () {
|
|||
"(-w -X)-W[enable all warnings (ignores 'no warnings')]" \
|
||||
"(-w -W )-X[disable all warnings (ignores 'use warnings')]" \
|
||||
'-x-[strip off text before #!perl line and perhaps cd to directory]:directory to cd to:_files -/' \
|
||||
'1:Perl script:_files -/ -g "*.(p[ml]|PL|t)(-.)"' \
|
||||
'1:script or arg:_script_or_arg' \
|
||||
'*::args: _normal'
|
||||
}
|
||||
|
||||
_script_or_arg () {
|
||||
local expl
|
||||
if [[ -n "$opt_args[(I)-(e|E)]" ]]; then
|
||||
_description arg expl 'file'
|
||||
_files "$expl[@]"
|
||||
else
|
||||
_description script expl 'Perl script'
|
||||
_files "$expl[@]" -/ -g "*.(p[ml]|PL|t)(-.)"
|
||||
fi
|
||||
}
|
||||
|
||||
_perl_m_opt () {
|
||||
compset -P '-'
|
||||
|
||||
|
|
Loading…
Reference in a new issue