Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: PATCH: update macos completions



On Wed 4 Jun 2025, at 23:20, Ryan Rotter wrote:
> - Add support for native macos trash command added in macOS 14.0 (per 
> `man trash`)

in this one you copied and pasted some stuff from above that isn't needed /
doesn't make sense, and the -A arg is wrong (no -s -S seems right though,
typical ad-hoc argument parsing from apple). i'll commit with this tweak if
that's ok

On Wed 4 Jun 2025, at 23:20, Ryan Rotter wrote:
> [I'd like to have _trash refuse to repeat filenames, just like 
> _git-add, but that's quite beyond my skill at this point]

most functions are just like that, _git is an exception

dana


diff --git a/Completion/Unix/Command/_trash b/Completion/Unix/Command/_trash
index 64ef69385..6315f218b 100644
--- a/Completion/Unix/Command/_trash
+++ b/Completion/Unix/Command/_trash
@@ -54,19 +54,11 @@ case $variant in
     return
     ;;
   darwin)
-    local -a args=(
-      '(-v --verbose)'{-v,--verbose}'[display more verbose status]'
-
-      + options
-      '(-s --stopOnError)'{-s,--stopOnError}'[exit with an error if any move to a trash folder fails]'
-
-      + info
-      '(- *)'{-h,--help}'[display help information]'
-
-      + input
-      '(actions)*: :_files'
-    )
-    _arguments -A : $args
+    _arguments -A '-*' : \
+      '(-v --verbose)'{-v,--verbose}'[display more verbose status]' \
+      '(-s --stopOnError)'{-s,--stopOnError}'[exit with error if any move to trash folder fails]' \
+      '(- *)'{-h,--help}'[display help information]' \
+      '*: :_files'
     return
     ;;
   *) _default ;;




Messages sorted by: Reverse Date, Date, Thread, Author