zsh-workers
 help / color / mirror / code / Atom feed
* [patch] _rmdir
@ 2018-04-28  5:01 Matthew Martin
  2018-04-29 23:21 ` Oliver Kiddle
  0 siblings, 1 reply; 2+ messages in thread
From: Matthew Martin @ 2018-04-28  5:01 UTC (permalink / raw)
  To: zsh-workers

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
 


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-04-29 23:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-28  5:01 [patch] _rmdir Matthew Martin
2018-04-29 23:21 ` Oliver Kiddle

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).