mirror of git://git.code.sf.net/p/zsh/code
44099: Completion: Add _trash
This commit is contained in:
parent
2055ee92e7
commit
a41f09f862
|
@ -1,3 +1,8 @@
|
|||
2019-03-06 dana <dana@dana.is>
|
||||
|
||||
* 44099: Completion/Darwin/Command/_trash: Add completion for
|
||||
macOS trash utility
|
||||
|
||||
2019-03-01 Jun-ichi Takimoto <takimoto-j@kba.biglobe.ne.jp>
|
||||
|
||||
* unposted: Test/ztst.zsh: fix a typo
|
||||
|
|
|
@ -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
|
Loading…
Reference in New Issue