From c68cfb1c36513e30ec5896444487694dcd4e12b6 Mon Sep 17 00:00:00 2001 From: Daniel Shahaf Date: Sat, 7 Oct 2017 00:27:01 +0000 Subject: 41825/0001: _stat: Only complete 'stat' if it's provided by the zsh/stat builtin. --- Completion/Zsh/Command/_stat | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'Completion/Zsh/Command') diff --git a/Completion/Zsh/Command/_stat b/Completion/Zsh/Command/_stat index 03e42e3af..303775b23 100644 --- a/Completion/Zsh/Command/_stat +++ b/Completion/Zsh/Command/_stat @@ -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 -- cgit 1.4.1