From: Shohei YOSHIDA <syohex@gmail.com>
To: zsh-workers@zsh.org
Cc: Shohei YOSHIDA <syohex@gmail.com>
Subject: [PATCH 1/1] Update softwareupdate completion for macOS 13
Date: Wed, 28 Jun 2023 18:47:34 +0900 [thread overview]
Message-ID: <20230628094734.130645-2-syohex@gmail.com> (raw)
In-Reply-To: <20230628094734.130645-1-syohex@gmail.com>
---
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
next prev parent reply other threads:[~2023-06-28 9:49 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-28 9:47 [PATCH 0/1] Update softwareupdate completion Shohei YOSHIDA
2023-06-28 9:47 ` Shohei YOSHIDA [this message]
2023-07-03 16:31 ` [PATCH 1/1] Update softwareupdate completion for macOS 13 Jun. T
2023-07-04 7:21 ` Jun T
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230628094734.130645-2-syohex@gmail.com \
--to=syohex@gmail.com \
--cc=zsh-workers@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).