diff options
author | Matthew Martin <phy1729@gmail.com> | 2019-04-22 22:04:24 -0500 |
---|---|---|
committer | Matthew Martin <phy1729@gmail.com> | 2019-04-22 22:04:24 -0500 |
commit | a4f44972076ac86bde7f8b96c18b10807d580965 (patch) | |
tree | e0bbd37e3c0f5eda842a7d58955ae9a9157afe0e /Completion/Unix/Command/_rmdir | |
parent | 64d13738357c9b9c212adbe17f271716abbcf6ea (diff) | |
download | zsh-a4f44972076ac86bde7f8b96c18b10807d580965.tar.gz zsh-a4f44972076ac86bde7f8b96c18b10807d580965.tar.xz zsh-a4f44972076ac86bde7f8b96c18b10807d580965.zip |
44242: Completion: Use _pick_variant -b to detect builtins
Diffstat (limited to 'Completion/Unix/Command/_rmdir')
-rw-r--r-- | Completion/Unix/Command/_rmdir | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/Completion/Unix/Command/_rmdir b/Completion/Unix/Command/_rmdir index 0f5e16912..2ae0fd9b2 100644 --- a/Completion/Unix/Command/_rmdir +++ b/Completion/Unix/Command/_rmdir @@ -1,22 +1,30 @@ #compdef rmdir grmdir +local variant local -a args args=( '(-p --parents)'{-p,--parents}'[remove each component of the specified paths]' ) -if _pick_variant gnu=GNU unix --version; then - args+=( - '--ignore-fail-on-non-empty[ignore failure if directory is non-empty]' - '(-v --verbose)'{-v,--verbose}'[be verbose]' - ) -else - args=(${args:#*\)--*}) - if [[ $OSTYPE == (dragonfly|freebsd)* ]]; then +_pick_variant -r variant -b zsh gnu=GNU $OSTYPE --version +case $variant; in + gnu) + args+=( + '--ignore-fail-on-non-empty[ignore failure if directory is non-empty]' + '(-v --verbose)'{-v,--verbose}'[be verbose]' + ) + ;; + zsh) + args=() + ;; + *) + args=(${args:#*\)--*}) + ;| + dragonfly*|freebsd*) args+=('-v[be verbose]') - fi -fi + ;; +esac _arguments -s -S -A '-*' \ $args \ |