Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
[PATCH] Completion: Add _trash
- X-seq: zsh-workers 44099
- From: dana <dana@xxxxxxx>
- To: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: [PATCH] Completion: Add _trash
- Date: Sun, 3 Mar 2019 15:14:24 -0600
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dana-is.20150623.gappssmtp.com; s=20150623; h=from:content-transfer-encoding:mime-version:subject:message-id:date :to; bh=RgbDnZCxvlbRaGPZz6EAfyLNpiVS+Pe2eg9bOEXq3xo=; b=C3xVDauT0KT/wBV8BlxkOrg9zdxMKuqllFr3+mA+40v0eovnzbDy/Nm86HAVeKWiBK UNG9VjiBofQksW60OwD7pjTBddXW4qoqxEepchF4GibANHd6bOXUwqzDfq5xQSAIOR6A GlphshSz05DhhWouRXIj744Ikg8vyM6YfoFRG+z2PhqSKhh4yU2eo5RVnIyDavnaW4va RxHtAt5WdTkpsHg06vSQFDNIkA1UgL2NwCGwYMs+TXJ700gugZPmj70AooiY5R1URh4b +AMwoRbj8CoOK34jNdyUuN4BSXO0RGZ7VFYVkNn++7Q1VpFaAp2HKme43tCqlkLpYFte HKWA==
- 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>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author