Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
[patch] _rmdir
- X-seq: zsh-workers 42730
- From: Matthew Martin <phy1729@xxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: [patch] _rmdir
- Date: Sat, 28 Apr 2018 00:01:13 -0500
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:subject:message-id:mail-followup-to:mime-version :content-disposition:user-agent; bh=5q9V7/ow6mxcxWK2uEdFyK8PVtsd7VbLfAn7pVeim0c=; b=ItHBlzkFYk7j/rZ8dEJbOjgEQRtubxYWZ9A91vdJVA7IbmViiT5p9ZmYurWSvnxkp1 BVSn9fGfqRL0Os8ugc8c/1u8Jmv0BALU8AhJ9pcaO/SC28UAwcpCtwXxZmmpFIeBkL1Q QCeeIKBOqbkt6Jy5yfmeCTpLt8Iksf2UjLs1UecuV6ei1+OQRUQzZpPfi0NHMUfsMBHR EH2Kw94h3+w35SPlqDe9DNaFE9khQfbaqWtHlXFIqvyBLM+JuIWBNtLIB19QvhOQsQz6 Oun/W1J7Wk2tMdKU6AVo+Akbc+YiZk+BFGjvsZsGuTDSLrfcAdYJTBiK6wr3HX6fA65S Og0g==
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-unsubscribe: <mailto:zsh-workers-unsubscribe@zsh.org>
- Mail-followup-to: zsh-workers@xxxxxxx
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
Complete the options for rmdir.
Is there an established position for --help and --version? Completing
them would be more complete, but also useless noise in my opinion.
- Matthew Martin
diff --git a/Completion/Unix/Command/_rmdir b/Completion/Unix/Command/_rmdir
new file mode 100644
index 000000000..0f5e16912
--- /dev/null
+++ b/Completion/Unix/Command/_rmdir
@@ -0,0 +1,23 @@
+#compdef rmdir grmdir
+
+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
+ args+=('-v[be verbose]')
+ fi
+fi
+
+_arguments -s -S -A '-*' \
+ $args \
+ '*:directories:_directories'
diff --git a/Completion/Unix/Type/_directories b/Completion/Unix/Type/_directories
index 456af3b6c..438181eec 100644
--- a/Completion/Unix/Type/_directories
+++ b/Completion/Unix/Type/_directories
@@ -1,4 +1,4 @@
-#compdef rmdir grmdir zf_rmdir dircmp -P -value-,*path,-default-
+#compdef zf_rmdir dircmp -P -value-,*path,-default-
local expl
Messages sorted by:
Reverse Date,
Date,
Thread,
Author