Parent directory

_trash-put

948 bytes
 1#compdef trash-put
 2
 3# Overrides /usr/share/zsh/site-functions/_trash-put (shtab-generated) which
 4# uses `::files:` (optional single positional), so only the first arg
 5# completes as a file and subsequent args only offer flags.
 6
 7_trash_files() {
 8  (( CURRENT > 0 )) && line[CURRENT]=()
 9  line=( ${line//(#m)[\[\]()\\*?#<>~\^\|]/\\$MATCH} )
10  _files -F line
11}
12
13_arguments -s \
14  '(- *)'{-h,--help}'[show this help message and exit]' \
15  '(- *)--print-completion[print shell completion script]:shell:(bash zsh tcsh)' \
16  '(- *)--version[show program version number and exit]' \
17  {-d,--directory}'[ignored (for GNU rm compatibility)]' \
18  {-f,--force}'[silently ignore nonexistent files]' \
19  {-i,--interactive}'[prompt before every removal]' \
20  {-r,-R,--recursive}'[ignored (for GNU rm compatibility)]' \
21  '--trash-dir[use TRASHDIR as trash folder]:trashdir:_files -/' \
22  '*'{-v,--verbose}'[explain what is being done]' \
23  '*:files:_trash_files'