zsh-workers
 help / Atom feed
* [PATCH] Completion: Add _trash
@ 2019-03-03 21:14 dana
  0 siblings, 0 replies; 1+ messages in thread
From: dana @ 2019-03-03 21:14 UTC (permalink / raw)
  To: Zsh hackers list

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


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

only message in thread, back to index

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-03 21:14 [PATCH] Completion: Add _trash dana

zsh-workers

Archives are clonable: git clone --mirror http://inbox.vuxu.org/zsh-workers

Newsgroup available over NNTP:
	nntp://inbox.vuxu.org/vuxu.archive.zsh.workers


AGPL code for this site: git clone https://public-inbox.org/ public-inbox