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

[PATCH 1/1] Update softwareupdate completion for macOS 13



---
 Completion/Darwin/Command/_softwareupdate | 58 ++++++++++-------------
 1 file changed, 25 insertions(+), 33 deletions(-)

diff --git a/Completion/Darwin/Command/_softwareupdate b/Completion/Darwin/Command/_softwareupdate
index 6054fd768..9cad43dc1 100644
--- a/Completion/Darwin/Command/_softwareupdate
+++ b/Completion/Darwin/Command/_softwareupdate
@@ -1,19 +1,8 @@
 #compdef softwareupdate
 
-_softwareupdate_ignored_update_name() {
-  if [[ -z "$_softwareupdate_ignored_updates" ]]; then
-    local res="$(_call_program pkgs softwareupdate --ignored)"
-    _softwareupdate_ignored_updates=("${(Qs/, /)${${res#Current ignored updates: \(}%\)}}")
-  fi
-  if (( ${#_softwareupdate_ignored_updates} > 0 )); then
-    _wanted pkgs expl "ignored package" compadd -a _softwareupdate_ignored_updates && return 0
-  fi
-  return 1
-}
-
 _softwareupdate_update_name() {
   local name line
-  if [[ -z "$_softwareupdate_updates" ]]; then
+  if [[ ! -v _softwareupdate_updates ]]; then
     _softwareupdate_updates=()
     for line in ${(f)"$(_call_program pkgs softwareupdate --list)"}; do
       if [[ $line == '   '* ]]; then
@@ -37,36 +26,39 @@ _softwareupdate() {
   _arguments -R \
     '(-h --help -l --list)-q[quiet mode]' \
     {-l,--list}'[list all available updates]:*:' \
-    {-d,--download}'[download to directory set in InternetConfig]:*:' \
+    {-d,--download}'[download only]:*:' \
     {-i,--install}'[install (requires root)]:*: :->install' \
-    '--ignored[show or manage ignored updates list (per-user)]:*:: :->ignored' \
+    '--list-full-installers[list the available macOS installers]' \
+    '--fetch-full-installer[install the latest recommended macOS installer]:*: :->fetch-installer' \
+    '--install-rosetta[install rosetta]' \
+    '--background[trigger a background scan and update operation]' \
     '--schedule[scheduler preferences (per-user)]:automatic checking:(on off)' \
+    '--dump-state[log the internal state of the SU daemon to /var/log/install.log]' \
+    '--evaluate-products[evaluate a list of product keys specified by the --products option]' \
+    '--history[show the install history]' \
+    '--no-scan[do not scan when listing or installing updates]' \
+    '--product-types[limit a scan to a particular product type only]:product_type' \
+    '--products[a comma separated list of product keys to operate on]:product_keys' \
+    '--force[force an operation to complete]' \
+    '--agree-to-license[agree to the software license agreement without user interaction]' \
+    '--verbose[enable verbose output]' \
     {-h,--help}'[print command usage]:*:' && return 0
 
   case "$state" in
     install)
       _arguments \
-        '(* -a --all)'{-a,--all}'[all available active updates]' \
-        '(* -r --req)'{-r,--req}'[all required active updates]' \
+        '(-a --all)'{-a,--all}'[all available active updates]' \
+        '(-r --recommended)'{-r,--recommended}'[all updates that are recommended for your system]' \
+        '--os-only[only macOS updates]' \
+        '--safari-only[only safari updates]' \
+        '(-R --restart)'{-R,--restart}'[automatically restart if required to complete installation]' \
+        '--stdinpass[password to authenticate as an owner]' \
+        '--user[local username to authenticate as an owner]' \
         '*:update name:_softwareupdate_update_name' && return 0
       ;;
-    ignored)
-      local -a ignored_subcmd
-      ignored_subcmd=(add remove)
-
-      if (( CURRENT == 1 )); then
-        _describe -t commands "subcommand" ignored_subcmd && return 0
-      fi
-      case $words[1] in
-        add)
-          _softwareupdate_update_name && return 0
-          ;;
-        remove)
-          _arguments \
-            '(* -a --all)'{-a,--all}'[all available active updates]' \
-            '*:update name:_softwareupdate_ignored_update_name' && return 0
-          ;;
-      esac
+    fetch-installer)
+      _arguments \
+        '--full-installer-version[specify the version macOS to install]:version' \
       ;;
   esac
   return 1
-- 
2.39.2





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