diff options
author | Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx> | 2017-10-07 00:27:01 +0000 |
---|---|---|
committer | Daniel Shahaf <d.s@daniel.shahaf.name> | 2017-10-11 17:50:30 +0000 |
commit | c68cfb1c36513e30ec5896444487694dcd4e12b6 (patch) | |
tree | 506fd0028a5ad61b06b5c7794ca9500dbbd7f327 | |
parent | 61b544a06832eb29035fb95a6bd942f77881300a (diff) | |
download | zsh-c68cfb1c36513e30ec5896444487694dcd4e12b6.tar.gz zsh-c68cfb1c36513e30ec5896444487694dcd4e12b6.tar.xz zsh-c68cfb1c36513e30ec5896444487694dcd4e12b6.zip |
41825/0001: _stat: Only complete 'stat' if it's provided by the zsh/stat builtin.
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | Completion/Zsh/Command/_stat | 9 |
2 files changed, 13 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog index b2871fc4b..d81f1b466 100644 --- a/ChangeLog +++ b/ChangeLog @@ -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, 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 |