summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShohei YOSHIDA <syohex@gmail.com>2023-08-28 13:12:50 +0900
committerJun-ichi Takimoto <takimoto-j@kba.biglobe.ne.jp>2023-08-28 13:12:50 +0900
commita8853323dd631ba26869ea6e0bf1b8098247731d (patch)
tree3f6d0f8b524e5334c85a716cc0700ec2befdfaf1
parent53fe16e9b52f44e2c9327901ef60b5a5a4384a96 (diff)
downloadzsh-a8853323dd631ba26869ea6e0bf1b8098247731d.tar.gz
zsh-a8853323dd631ba26869ea6e0bf1b8098247731d.zip
52098, 52099, 52100, 52105(+minor tweak): update for latest macOS
-rw-r--r--ChangeLog6
-rw-r--r--Completion/Darwin/Command/_open8
-rw-r--r--Completion/Darwin/Command/_otool7
-rw-r--r--Completion/Darwin/Command/_sw_vers7
-rw-r--r--Completion/Darwin/Command/_system_profiler12
5 files changed, 29 insertions, 11 deletions
diff --git a/ChangeLog b/ChangeLog
index 9b583a6ed..356d7a48c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
2023-08-28 Jun-ichi Takimoto <takimoto-j@kba.biglobe.ne.jp>
+ * Shohei YOSHIDA: 52098(+comment), 52099, 52100, 52105(+52106):
+ Completion/Darwin/Command/_open, Completion/Darwin/Command/_otool,
+ Completion/Darwin/Command/_sw-vers,
+ Completion/Darwin/Command/_system_profiler:
+ update for latest macOS (with a few fixes)
+
* sergio: 51858 (+52073): Completion/Unix/Command/_libvirt:
virsh's edit subcommand accepts all domains
diff --git a/Completion/Darwin/Command/_open b/Completion/Darwin/Command/_open
index 2563e5eb5..1c693dfb8 100644
--- a/Completion/Darwin/Command/_open
+++ b/Completion/Darwin/Command/_open
@@ -25,14 +25,20 @@ _open() {
'(: * -)--args[pass remaining arguments to application]:*:::argument' \
'(-a -b -e -f -R -t)-b+[specify application bundle identifier]: :->bundle-ids' \
'(-a -b -e -f -R -t)-e[open with TextEdit]' \
+ '*--env[add the environment variable of the launched application]:env_var=value:_parameters -g "*export*" -qS=' \
'(-h)-f[open standard input with TextEdit or specified application]' \
'(-R)-F[open application with fresh state]' \
- '-g[do not bring application to foreground]' \
+ '(-j)-g[do not bring application to foreground]' \
'(-f)-h[open library header file]' \
+ '(-g)-j[launch the app hidden]' \
'(-R)-n[always open new instance of application]' \
'(-a -b -e -f -F -n -s -t -W --args)-R[reveal in Finder]' \
'(-R)-s+[specify SDK name/version]: :->sdks' \
+ '--stdin[launch the application with stdin connected to the given file]:file:_files' \
+ '--stdout[launch the application with stdout connected to the given file]:file:_files' \
+ '--stderr[launch the application with stderr connected to the given file]:file:_files' \
'(-a -b -e -f -R -t)-t[open with default text editor]' \
+ '-u[open URL with whatever application claims the url scheme]:url:_urls' \
'(-R)-W[wait for application to exit]' \
'(-f)*: :->files' \
&& ret=0
diff --git a/Completion/Darwin/Command/_otool b/Completion/Darwin/Command/_otool
index c3fc70b91..b6a30a730 100644
--- a/Completion/Darwin/Command/_otool
+++ b/Completion/Darwin/Command/_otool
@@ -13,6 +13,7 @@ _arguments \
'-D[display just the internal name of shared lib]' \
'-s[display the contents of the specified section]:segment name: :section name: ' \
'-t[display the contents of (__TEXT,__text) section]' \
+ '-x[display the content of every __text section found in the file]' \
'-d[display the contents of (__DATA,__data) section]' \
'-o[display the contents of __OBJC segment]' \
'-r[display the relocation entries]' \
@@ -25,6 +26,9 @@ _arguments \
'-G[display the data in code table]' \
'-C[display the linker optimization hints]' \
'-P[print the info_plist section as strings]' \
+ '-dyld_info[print bind and rebase information used by dyld]' \
+ '-dyld_opcodes[print raw dyld bind and rebase opcodes present in a final linked binary]' \
+ '-chained_fixups[print raw chained fixup data present in a final linked binary]' \
'-p[with -t and -v/V: start disassembly from the specified symbol]:symbol name: ' \
'-v[display verbosely (symbolically) when possible]' \
'-V[display disassembled operands symbolically]' \
@@ -34,7 +38,8 @@ _arguments \
'-function_offsets[with disassembly, print decimal offset from the last label]' \
'-j[with disassembly, print opcode bytes]' \
"-Q[use otool's disassembler]" \
- '-arch[select the specified architecture from a universal file]:arch:(i386 x86_64)' \
+ '-addr_slide=[add an arbitrary slide to each pointer value when it is displayed]:slide size' \
+ '-arch[select the specified architecture from a universal file]:arch:(i386 x86_64 x86_64h arm64 arm64e all)' \
'-m[object file names are not assumed to be in archive(member) syntax]' \
'(- *)--version[print version of otool]' \
'*:file:_object_files' && return 0
diff --git a/Completion/Darwin/Command/_sw_vers b/Completion/Darwin/Command/_sw_vers
index 11814e0b0..415d3a05c 100644
--- a/Completion/Darwin/Command/_sw_vers
+++ b/Completion/Darwin/Command/_sw_vers
@@ -1,6 +1,11 @@
#compdef sw_vers
+# Only options with a single dash '-' are accepted on Monterey or older,
+# but both a single and double dashes are accepted on Ventura (or newer).
+# We may replace '-' by '--' when Monterey fades out.
+
_arguments : \
'(-)-buildVersion[display build version only]' \
'(-)-productName[display product name only]' \
- '(-)-productVersion[display product version only]'
+ '(-)-productVersion[display product version only]' \
+ '(-)-productVersionExtra[display rapid security response version only]'
diff --git a/Completion/Darwin/Command/_system_profiler b/Completion/Darwin/Command/_system_profiler
index fe197579d..0fd8b473b 100644
--- a/Completion/Darwin/Command/_system_profiler
+++ b/Completion/Darwin/Command/_system_profiler
@@ -4,17 +4,13 @@ typeset -A opt_args
local context state state_descr line
local -a _data_types
-# TODO: Should this be static? Calling `system_profiler -listDataTypes` takes
-# about 0.07-0.08 secs on my machine. Does this list ever change (between
-# different versions of OS X)?
-_data_types=( SP{AirPort,Applications,Audio,Bluetooth,Camera,CardReader,Component,ConfigurationProfile,DeveloperTools,Diagnostics,DisabledSoftware,DiscBurning,Displays,Ethernet,Extensions,FibreChannel,FireWire,Firewall,Fonts,Frameworks,Hardware,HardwareRAID,InstallHistory,Logs,ManagedClient,Memory,Network,NetworkLocation,NetworkVolume,PCI,ParallelATA,ParallelSCSI,Power,PrefPane,Printers,PrintersSoftware,SAS,SPI,SerialATA,Software,StartupItem,Storage,SyncServices,Thunderbolt,USB,UniversalAccess,WWAN}DataType )
-# the dynamic alternative is:
-#_data_types=( ${${(f)"$(_call_program path system_profiler -listDataTypes 2>/dev/null)"}[2,-1]} )
+_data_types=( ${${(f)"$(_call_program data-types system_profiler -listDataTypes 2>/dev/null)"}[2,-1]} )
_arguments \
'(- *)-usage' \
'(- *)-listDataTypes[lists the available datatypes]' \
- '(-listDataTypes -usage)-xml[generate xml output]' \
+ '(-listDataTypes -usage -json)-xml[generate xml output]' \
+ '(-listDataTypes -usage -xml)-json[generate json output]' \
'(-listDataTypes -usage)-detailLevel[level of detail for the report]:detail level:(mini basic full)' \
- '(-listDataTypes -usage)-timeout+[maximum time to wait in seconds]' \
+ '(-listDataTypes -usage)-timeout+[maximum time to wait in seconds(0 means no timeout)]:timeout seconds' \
'(-listDataTypes -usage)*:data type:'"($_data_types)"