From: dana <dana@dana.is>
To: Zsh hackers list <zsh-workers@zsh.org>
Subject: [PATCH] Completion: Add _trash
Date: Sun, 3 Mar 2019 15:14:24 -0600 [thread overview]
Message-ID: <0AEBC5FB-9CE8-4E1D-8A9B-C6667E765090@dana.is> (raw)
Completion for the rm-like tool for macOS
dana
diff --git a/Completion/Darwin/Command/_trash b/Completion/Darwin/Command/_trash
new file mode 100644
index 000000000..658716432
--- /dev/null
+++ b/Completion/Darwin/Command/_trash
@@ -0,0 +1,22 @@
+#compdef trash
+
+# We only provide completion for Ali Rantakari's trash utility. There are/were a
+# few others floating around with that name, but this is the one available as
+# `trash` in Homebrew and MacPorts
+_pick_variant ali='(Rantakari|hasseg)' other --version && {
+ # The hidden options here are options to rm that trash silently (and
+ # undocumentedly) ignores. Some options are not made mutually exclusive where
+ # they technically could be, for compatibility with aliases, etc.
+ _arguments -s -S -A '-*' : \
+ '!-'{d,f,i,r,P,R,W} \
+ '(: * -F -l -v)-e[empty trash]' \
+ '-F[use Finder instead of system API]' \
+ '(: * -e -F -s -y)-l[list items in trash]' \
+ '(: * -F -l -v)-s[securely empty trash]' \
+ '-v[increase output verbosity]' \
+ '-y[skip confirmation prompts (with -e or -s)]' \
+ '*: :_files'
+ return
+}
+
+_default
reply other threads:[~2019-03-03 21:15 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=0AEBC5FB-9CE8-4E1D-8A9B-C6667E765090@dana.is \
--to=dana@dana.is \
--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).