zsh-workers
 help / color / mirror / code / Atom feed
From: Matthew Martin <phy1729@gmail.com>
To: zsh-workers@zsh.org
Subject: [patch] _rmdir
Date: Sat, 28 Apr 2018 00:01:13 -0500	[thread overview]
Message-ID: <20180428050112.GA81400@CptOrmolo.darkstar> (raw)

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
 


             reply	other threads:[~2018-04-28  5:01 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-28  5:01 Matthew Martin [this message]
2018-04-29 23:21 ` Oliver Kiddle

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180428050112.GA81400@CptOrmolo.darkstar \
    --to=phy1729@gmail.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).