1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-11-01 18:30:55 +01:00

41825/0001: _stat: Only complete 'stat' if it's provided by the zsh/stat builtin.

This commit is contained in:
Daniel Shahaf 2017-10-07 00:27:01 +00:00 committed by Daniel Shahaf
parent 61b544a068
commit c68cfb1c36
2 changed files with 13 additions and 1 deletions

View file

@ -1,3 +1,8 @@
2017-10-11 Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
* 41825/0001: Completion/Zsh/Command/_stat: Only complete 'stat'
if it's provided by the zsh/stat builtin.
2017-10-10 Oliver Kiddle <opk@zsh.org>
* 41855: Completion/Unix/Command/_dhclient,

View file

@ -4,7 +4,10 @@ local expl ret=1
if [[ "$words[CURRENT-1]" = -[AH] ]]; then
_arrays
else
elif [[ $service == zstat ]] ||
(( ${+builtins[stat]} )) ||
{ (( ! ${+builtins} )) && [[ $(type -w stat) == '*: builtin' ]] }
then
_tags files options || return 1
while _tags; do
@ -17,4 +20,8 @@ else
+size +atime +mtime +ctime +blksize +block +link
(( ret )) || return 0
done
else
# TODO: system-specific completion
# TODO: choose this codepath if 'command stat ...' or '=stat ...' is used
_files
fi