mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-09-18 15:21:16 +02:00
Greg Klanderman: 27377 (slightly tweaked): fix ignored (duplicate) file names
This commit is contained in:
parent
b159a6bba2
commit
f91f79c457
1 changed files with 5 additions and 2 deletions
|
@ -5,7 +5,7 @@ args=(
|
|||
'(-f --force)'{-f,--force}'[ignore nonexistent files, never prompt]'
|
||||
'(-I --interactive)-i[prompt before every removal]'
|
||||
'(-r -R --recursive)'{-r,-R,--recursive}'[remove directories and their contents recursively]'
|
||||
'*:files:->file'
|
||||
'*::files:->file'
|
||||
)
|
||||
if _pick_variant gnu=gnu unix --help; then
|
||||
opts+=(-S)
|
||||
|
@ -33,7 +33,10 @@ _arguments -C $opts \
|
|||
case $state in
|
||||
(file)
|
||||
declare -a ignored
|
||||
ignored=(${line//(#m)[\[\]()\\*?#<>~\^]/\\$MATCH})
|
||||
if ((CURRENT > 1)); then
|
||||
ignored=(${line[1,CURRENT-1]//(#m)[\[\]()\\*?#<>~\^]/\\$MATCH})
|
||||
ignored+=(${line[CURRENT+1,-1]//(#m)[\[\]()\\*?#<>~\^]/\\$MATCH})
|
||||
fi
|
||||
_files -F ignored && ret=0
|
||||
;;
|
||||
esac
|
||||
|
|
Loading…
Reference in a new issue