1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2026-01-03 20:51:07 +01:00

28579: propagate failure status from _arguments in _du so that _complete

will try other completions.
This commit is contained in:
Bart Schaefer 2011-01-06 16:57:40 +00:00
parent 87d6527628
commit 5d2a7bc3bf
2 changed files with 11 additions and 4 deletions

View file

@ -1,5 +1,8 @@
2011-01-06 Barton E. Schaefer <schaefer@zsh.org>
* 28579: Completion/Unix/Command/_du: propagate failure status
from _arguments so that _complete will try other completions.
* 28578 (plus test): Src/utils.c, Src/zsh.h, Test/B03print.ztst:
fix handling of numeric escapes that expand to "%" in printf
format strings, so they are not treated as format introducers.
@ -14049,5 +14052,5 @@
*****************************************************
* This is used by the shell to define $ZSH_PATCHLEVEL
* $Revision: 1.5169 $
* $Revision: 1.5170 $
*****************************************************

View file

@ -1,6 +1,8 @@
#compdef du
if _pick_variant gnu=Free\ Soft unix --version /dummy/no-such-file; then
local ret=1
_arguments -s \
'(-a --all -s --summarize)'{-a,--all}'[write counts for all files]' \
'--apparent-size[print apparent sizes rather than disc usage]' \
@ -27,22 +29,24 @@ if _pick_variant gnu=Free\ Soft unix --version /dummy/no-such-file; then
'--time=-[show time of last modification of any file in the directory]:property:->time' \
'(* -)--help[display help information]' \
'(* -)--version[display version information]' \
'*:file:_files'
'*:file:_files' && ret=0
case $state in
(time)
local -a property
property=(atime access use ctime status)
_wanted property expl property compadd -a property
_wanted property expl property compadd -a property && ret=0
;;
(timestyle)
local -a style desc
style=(full-iso long-iso iso +)
desc=('full-iso' 'long-iso' 'iso' '+FORMAT like `date'\''')
_wanted -V style expl style compadd -d desc -a style
_wanted -V style expl style compadd -d desc -a style && ret=0
;;
esac
return ret
else
# based on $OSTYPE = solaris2.8
local xdev='[skip directories on different filesystems]'