1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2024-05-07 08:06:22 +02:00

52098, 52099, 52100, 52105(+minor tweak): update for latest macOS

This commit is contained in:
Shohei YOSHIDA 2023-08-28 13:12:50 +09:00 committed by Jun-ichi Takimoto
parent 53fe16e9b5
commit a8853323dd
5 changed files with 29 additions and 11 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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]'

View File

@ -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)"