├── .gitignore ├── LICENSE ├── README.md ├── completions ├── _PlistBuddy ├── _bbedit ├── _desktoppr ├── _gh ├── _installer ├── _jamf ├── _plutil ├── _project ├── _see ├── _softwareupdate ├── _swift ├── _xcrun └── _xed ├── mac-zsh-completions.plugin.zsh └── todo.md /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | .DS_Store 3 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "{}" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright {yyyy} {name of copyright owner} 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | 203 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # macOS zsh Completions 2 | 3 | Some zsh completion files for macOS specific commands and third party tools. 4 | 5 | Pull requests and contributions are welcome! 6 | 7 | ## Setup and Installation 8 | 9 | To use mac-zsh-completions on your Mac, follow these steps: 10 | 11 | - download the project zip or `git clone` the project 12 | - in your `.zshrc` (or other zsh configuration file) add the full path to the `mac-zsh-completions/completions` directory to the `fpath`, e.g. 13 | 14 | ```zsh 15 | fpath=( ~/Projects/mac-zsh-completions/completions $fpath ) 16 | ``` 17 | 18 | - the command to load `compinit` should come _after_ modifying the `fpath` in your `.zshrc` 19 | 20 | - open a new Terminal window to get the new completions 21 | 22 | - sometimes (rarely) you may have to delete the `~/.zcompdump` file 23 | 24 | ```zsh 25 | % rm ~/.zcompdump 26 | % compinit 27 | ``` 28 | 29 | - remember to regularly re-download or `git pull` for new completions and updates 30 | 31 | ### Install via [oh-my-zsh](https://github.com/robbyrussell/oh-my-zsh/) 32 | 33 | ```zsh 34 | git clone git@github.com:scriptingosx/mac-zsh-completions.git "$ZSH_CUSTOM/plugins/mac-zsh-completions" 35 | ``` 36 | 37 | - Add to your `~/.zshrc` plugins array `plugins=(... mac-zsh-completions)` 38 | - Run `source ~/.zshrc` or restart your shell to activate 39 | 40 | ## Comments and Discussion 41 | 42 | Aside from issues and pull request, I suggest the `#zsh` channel on the [MacAdmins Slack](http://macadmins.org) for discussion. 43 | -------------------------------------------------------------------------------- /completions/_PlistBuddy: -------------------------------------------------------------------------------- 1 | #compdef PlistBuddy 2 | 3 | _PlistBuddy() { 4 | _arguments \ 5 | "-c[\"\" execute command, otherwise run in interactive mode]" \ 6 | "-x[output will be in the form of an xml plist where appropriate]" \ 7 | "-h[print the complete help info, with command guide]" \ 8 | "*::filename:_files" 9 | } -------------------------------------------------------------------------------- /completions/_bbedit: -------------------------------------------------------------------------------- 1 | #compdef bbedit 2 | 3 | _bbedit() { 4 | _arguments -s -S \ 5 | "--append[append piped data to the active text document]" \ 6 | "(-b --background)"{-b,--background}"[launch in background]" \ 7 | "--clean[data will be placed in an untitled, unmodifed document]" \ 8 | "(-c --create)"{-c,--create}"[create the specified files, unless they exist already, in which case they are opened.]" \ 9 | "(-e --encoding)"{-e,--encoding}"[set the text encoding]:_values" \ 10 | "--front-window[opens in the frontmost text window]" \ 11 | "(-h --help)"{-h,--help}"[show help]" \ 12 | "(-l --launch)"{-l,--launch}"[launch without opening any files]" \ 13 | "(-m --language)"{-m,--language}"[specify the source language (e.g. Ruby, Python, etc.)]:_values" \ 14 | "--maketags[generate a BBEdit compatible ctags 'tags' file for all eligible files in the current directory]" \ 15 | "--new-window[opens in a new window]" \ 16 | "--prepend[prepend piped data to the active text document]" \ 17 | "(-p --print)"{-p,--print}"[print the specified files on your currently selected printer]" \ 18 | "--project[creates a synthetic project (named with $CWD)]" \ 19 | "(-t --pipe-title)"{-t,--pipe-title}"[sets the title of the window]:_values" \ 20 | "(-s --worksheet)"{-s,--worksheet}"[create a new shell worksheet file with the specified name]:_values" \ 21 | "--scratchpad[appends the data provided on STDIN to the scratchpad]" \ 22 | "--separate-windows[opens each file into its own text window]" \ 23 | "(-v --version)"{-v,--version}"[display the current version number of the bbedit command line tool and the BBEdit application]" \ 24 | "-V, --short-version[display the short-form version number of the bbedit command line tool]" \ 25 | "--view-top[piped data will be placed into a new document which will have its scrollbar positioned at the top rather than the end]" \ 26 | "--resume[this switch will cause the application which was frontmost when the bbedit tool was invoked to be made frontmost again once you close the file (use with -w, --wait)]" \ 27 | "(-w --wait)"{-w,--wait}"[wait until the file is closed in BBEdit]" \ 28 | "*::filename:_files" 29 | } 30 | -------------------------------------------------------------------------------- /completions/_desktoppr: -------------------------------------------------------------------------------- 1 | #compdef desktoppr 2 | 3 | _arguments \ 4 | '::screens:(( main\:"main screen" all\:"all screens (default)" 0\:"screen no 0" 1\:"screen no 1" 2\:"screen no 2" 3\:"screen no 3" 4\:"screen no 4" 5\:"screen no 5" ))' \ 5 | ':filename:_files' 6 | 7 | -------------------------------------------------------------------------------- /completions/_gh: -------------------------------------------------------------------------------- 1 | #compdef gh 2 | compdef _gh gh 3 | 4 | # zsh completion for gh -*- shell-script -*- 5 | 6 | __gh_debug() 7 | { 8 | local file="$BASH_COMP_DEBUG_FILE" 9 | if [[ -n ${file} ]]; then 10 | echo "$*" >> "${file}" 11 | fi 12 | } 13 | 14 | _gh() 15 | { 16 | local shellCompDirectiveError=1 17 | local shellCompDirectiveNoSpace=2 18 | local shellCompDirectiveNoFileComp=4 19 | local shellCompDirectiveFilterFileExt=8 20 | local shellCompDirectiveFilterDirs=16 21 | local shellCompDirectiveKeepOrder=32 22 | 23 | local lastParam lastChar flagPrefix requestComp out directive comp lastComp noSpace keepOrder 24 | local -a completions 25 | 26 | __gh_debug "\n========= starting completion logic ==========" 27 | __gh_debug "CURRENT: ${CURRENT}, words[*]: ${words[*]}" 28 | 29 | # The user could have moved the cursor backwards on the command-line. 30 | # We need to trigger completion from the $CURRENT location, so we need 31 | # to truncate the command-line ($words) up to the $CURRENT location. 32 | # (We cannot use $CURSOR as its value does not work when a command is an alias.) 33 | words=("${=words[1,CURRENT]}") 34 | __gh_debug "Truncated words[*]: ${words[*]}," 35 | 36 | lastParam=${words[-1]} 37 | lastChar=${lastParam[-1]} 38 | __gh_debug "lastParam: ${lastParam}, lastChar: ${lastChar}" 39 | 40 | # For zsh, when completing a flag with an = (e.g., gh -n=) 41 | # completions must be prefixed with the flag 42 | setopt local_options BASH_REMATCH 43 | if [[ "${lastParam}" =~ '-.*=' ]]; then 44 | # We are dealing with a flag with an = 45 | flagPrefix="-P ${BASH_REMATCH}" 46 | fi 47 | 48 | # Prepare the command to obtain completions 49 | requestComp="${words[1]} __complete ${words[2,-1]}" 50 | if [ "${lastChar}" = "" ]; then 51 | # If the last parameter is complete (there is a space following it) 52 | # We add an extra empty parameter so we can indicate this to the go completion code. 53 | __gh_debug "Adding extra empty parameter" 54 | requestComp="${requestComp} \"\"" 55 | fi 56 | 57 | __gh_debug "About to call: eval ${requestComp}" 58 | 59 | # Use eval to handle any environment variables and such 60 | out=$(eval ${requestComp} 2>/dev/null) 61 | __gh_debug "completion output: ${out}" 62 | 63 | # Extract the directive integer following a : from the last line 64 | local lastLine 65 | while IFS='\n' read -r line; do 66 | lastLine=${line} 67 | done < <(printf "%s\n" "${out[@]}") 68 | __gh_debug "last line: ${lastLine}" 69 | 70 | if [ "${lastLine[1]}" = : ]; then 71 | directive=${lastLine[2,-1]} 72 | # Remove the directive including the : and the newline 73 | local suffix 74 | (( suffix=${#lastLine}+2)) 75 | out=${out[1,-$suffix]} 76 | else 77 | # There is no directive specified. Leave $out as is. 78 | __gh_debug "No directive found. Setting do default" 79 | directive=0 80 | fi 81 | 82 | __gh_debug "directive: ${directive}" 83 | __gh_debug "completions: ${out}" 84 | __gh_debug "flagPrefix: ${flagPrefix}" 85 | 86 | if [ $((directive & shellCompDirectiveError)) -ne 0 ]; then 87 | __gh_debug "Completion received error. Ignoring completions." 88 | return 89 | fi 90 | 91 | local activeHelpMarker="_activeHelp_ " 92 | local endIndex=${#activeHelpMarker} 93 | local startIndex=$((${#activeHelpMarker}+1)) 94 | local hasActiveHelp=0 95 | while IFS='\n' read -r comp; do 96 | # Check if this is an activeHelp statement (i.e., prefixed with $activeHelpMarker) 97 | if [ "${comp[1,$endIndex]}" = "$activeHelpMarker" ];then 98 | __gh_debug "ActiveHelp found: $comp" 99 | comp="${comp[$startIndex,-1]}" 100 | if [ -n "$comp" ]; then 101 | compadd -x "${comp}" 102 | __gh_debug "ActiveHelp will need delimiter" 103 | hasActiveHelp=1 104 | fi 105 | 106 | continue 107 | fi 108 | 109 | if [ -n "$comp" ]; then 110 | # If requested, completions are returned with a description. 111 | # The description is preceded by a TAB character. 112 | # For zsh's _describe, we need to use a : instead of a TAB. 113 | # We first need to escape any : as part of the completion itself. 114 | comp=${comp//:/\\:} 115 | 116 | local tab="$(printf '\t')" 117 | comp=${comp//$tab/:} 118 | 119 | __gh_debug "Adding completion: ${comp}" 120 | completions+=${comp} 121 | lastComp=$comp 122 | fi 123 | done < <(printf "%s\n" "${out[@]}") 124 | 125 | # Add a delimiter after the activeHelp statements, but only if: 126 | # - there are completions following the activeHelp statements, or 127 | # - file completion will be performed (so there will be choices after the activeHelp) 128 | if [ $hasActiveHelp -eq 1 ]; then 129 | if [ ${#completions} -ne 0 ] || [ $((directive & shellCompDirectiveNoFileComp)) -eq 0 ]; then 130 | __gh_debug "Adding activeHelp delimiter" 131 | compadd -x "--" 132 | hasActiveHelp=0 133 | fi 134 | fi 135 | 136 | if [ $((directive & shellCompDirectiveNoSpace)) -ne 0 ]; then 137 | __gh_debug "Activating nospace." 138 | noSpace="-S ''" 139 | fi 140 | 141 | if [ $((directive & shellCompDirectiveKeepOrder)) -ne 0 ]; then 142 | __gh_debug "Activating keep order." 143 | keepOrder="-V" 144 | fi 145 | 146 | if [ $((directive & shellCompDirectiveFilterFileExt)) -ne 0 ]; then 147 | # File extension filtering 148 | local filteringCmd 149 | filteringCmd='_files' 150 | for filter in ${completions[@]}; do 151 | if [ ${filter[1]} != '*' ]; then 152 | # zsh requires a glob pattern to do file filtering 153 | filter="\*.$filter" 154 | fi 155 | filteringCmd+=" -g $filter" 156 | done 157 | filteringCmd+=" ${flagPrefix}" 158 | 159 | __gh_debug "File filtering command: $filteringCmd" 160 | _arguments '*:filename:'"$filteringCmd" 161 | elif [ $((directive & shellCompDirectiveFilterDirs)) -ne 0 ]; then 162 | # File completion for directories only 163 | local subdir 164 | subdir="${completions[1]}" 165 | if [ -n "$subdir" ]; then 166 | __gh_debug "Listing directories in $subdir" 167 | pushd "${subdir}" >/dev/null 2>&1 168 | else 169 | __gh_debug "Listing directories in ." 170 | fi 171 | 172 | local result 173 | _arguments '*:dirname:_files -/'" ${flagPrefix}" 174 | result=$? 175 | if [ -n "$subdir" ]; then 176 | popd >/dev/null 2>&1 177 | fi 178 | return $result 179 | else 180 | __gh_debug "Calling _describe" 181 | if eval _describe $keepOrder "completions" completions $flagPrefix $noSpace; then 182 | __gh_debug "_describe found some completions" 183 | 184 | # Return the success of having called _describe 185 | return 0 186 | else 187 | __gh_debug "_describe did not find completions." 188 | __gh_debug "Checking if we should do file completion." 189 | if [ $((directive & shellCompDirectiveNoFileComp)) -ne 0 ]; then 190 | __gh_debug "deactivating file completion" 191 | 192 | # We must return an error code here to let zsh know that there were no 193 | # completions found by _describe; this is what will trigger other 194 | # matching algorithms to attempt to find completions. 195 | # For example zsh can match letters in the middle of words. 196 | return 1 197 | else 198 | # Perform file completion 199 | __gh_debug "Activating file completion" 200 | 201 | # We must return the result of this command, so it must be the 202 | # last command, or else we must store its result to return it. 203 | _arguments '*:filename:_files'" ${flagPrefix}" 204 | fi 205 | fi 206 | fi 207 | } 208 | 209 | # don't run the completion function when being source-ed or eval-ed 210 | if [ "$funcstack[1]" = "_gh" ]; then 211 | _gh 212 | fi 213 | -------------------------------------------------------------------------------- /completions/_installer: -------------------------------------------------------------------------------- 1 | #compdef installer 2 | 3 | _installer() { 4 | _arguments \ 5 | "-dominfo[display domains that can be installed into]" \ 6 | "-volinfo[display volumes that can be installed onto]" \ 7 | "-pkginfo[display package that will be installed (for metapackages, shows contents)]" \ 8 | "-query[display information about package metadata]:query flag:(RestartAction)" \ 9 | "-allowUntrusted[allow installing a package signed by an untrusted (or expired) certificate]" \ 10 | "-dumplog[write log information to standard error (in addition to the usual syslog)]" \ 11 | "-help[display help information]" \ 12 | "(-verboseR)-verbose[display detailed information]" \ 13 | "(-verbose)-verboseR[display detailed information with simplified progress output]" \ 14 | "-vers[display tool version]" \ 15 | "-config[display command line parameters in XML plist format]" \ 16 | "-plist[display -dominfo, -volinfo, or -pkginfo in XML plist format (ignored when performing installation)]" \ 17 | "-file[configuration file supplying parameters in XML plist format]:path to plist file" \ 18 | "-lang[sets the default language Mac OS X will use after installation]:iso language code" \ 19 | "-listiso[lists the ISO language codes that are recognized]" \ 20 | "(-showChoicesAfterApplyingChangesXML -applyChoiceChangesXML)-showChoicesXML[output XML data describing the choices and their properties and state]" \ 21 | "(-showChoicesXML -applyChoiceChangesXML)-showChoicesAfterApplyingChangesXML[apply changes specified in the file to the choices in the package and output the resulting XML data]:path to choice changes xml file:_files" \ 22 | "(-showChoicesXML -showChoicesAfterApplyingChangesXML)-applyChoiceChangesXML[apply changes specified in the file to the package and proceeds with installation]:path to choice changes xml file:_files" \ 23 | "(-target -tgt)"{-target,-tgt}"[path to target volume or domain]:path to target volume or domain:_files -/" \ 24 | "(-package -pkg)"{-package,-pkg}"[path to package file]:path to package file:_files -g *.{pkg,mpkg}" 25 | } -------------------------------------------------------------------------------- /completions/_jamf: -------------------------------------------------------------------------------- 1 | #compdef jamf 2 | 3 | 4 | _jamf() { 5 | local -a _jamf_verbs 6 | _jamf_verbs=( 7 | "about:displays information about the jamf binary" 8 | "bind:binds this computer to a directory service" 9 | "bless:blesses a System or a NetBoot Server" 10 | "changePassword:changes a local user's password" 11 | "checkJSSConnection:checks the availability of the JSS" 12 | "createAccount:creates a new local account on the system" 13 | "createConf:creates a configuration file that the jamf binary uses to find the JSS" 14 | "createHooks:creates and configures login/logout hooks" 15 | "createSetupDone:ensures the Setup Assistant does not launch immediately on the next boot" 16 | "createStartupItem:creates a startup script to contact the JSS" 17 | "deleteAccount:deletes a local account from NetInfo or the local dscl database" 18 | "deletePrinter:deletes a printer from the system" 19 | "deleteSetupDone:causes the Setup Assistant to launch on the next boot" 20 | "displayMessage:displays a message to the current user" 21 | "enablePermissions:enables permissions on a volume" 22 | "enroll:enrolls this computer with the JSS" 23 | "fixByHostFiles:fixes the ByHost files" 24 | "fixDocks:repairs docks that have question marks after certain OS Updates" 25 | "fixPermissions:fixes the permissions on a given target" 26 | "flushCaches:flush cache files for the system and/or users" 27 | "flushPolicyHistory:flush the policy history on the JSS" 28 | "getARDFields:displays the ARD Fields on a volume" 29 | "getComputerName:displays the computer name on a volume" 30 | "help:displays this message or details on a specific verb" 31 | "install:installs a package" 32 | "installAllCached:installs all packages that are cached" 33 | "listUsers:lists all the users on the computer" 34 | "log:log the IP address, action, and username to the JSS" 35 | "manage:enforces the entire management framework from the JSS" 36 | "mapPrinter:maps a printer" 37 | "mcx:apply Managed Preferences" 38 | "modifyDock:installs or removes items in all users docks" 39 | "mount:mounts a file share" 40 | "policy:checks for policies on the JSS" 41 | "reboot:reboots the computer" 42 | "recon:runs Recon to update the inventory in the JSS" 43 | "removeFramework:removes the JAMF Binary and associated files from the computer" 44 | "removeSWUSettings:remove settings that point SWU at internal servers" 45 | "resetPassword:resets a local user account password" 46 | "runScript:runs a script" 47 | "runSoftwareUpdate:run Software Update" 48 | "setARDFields:sets the ARD Fields" 49 | "setComputerName:sets the computer name" 50 | "setHomePage:sets the default home page for users" 51 | "setOFP:sets the Open Firmware mode and password" 52 | "startSSH:starts the ssh server" 53 | "uninstall:uninstalls a package" 54 | "unmountServer:unmounts a file server" 55 | "updatePrebindings:updates the prebindings on a volume" 56 | "version:prints the version of this application" 57 | ) 58 | 59 | local -a _global_options 60 | _global_options=( 61 | "-displayJSSTraffic[displays the total network traffic between the jamf binary and the JSS]" 62 | "-randomDelaySeconds[delays a random amount of time before starting]:maximum delay" 63 | "-verbose[shows verbose events]" 64 | "-showPID[prints the PID of the process]" 65 | ) 66 | 67 | local curcontext="$curcontext" state line expl 68 | local -A opt_args 69 | 70 | _arguments -C '*:: :->verbs' 71 | 72 | if (( CURRENT == 1 )); then 73 | _describe -t commands "jamf verb" _jamf_verbs 74 | return 75 | fi 76 | 77 | case "$words[1]" in 78 | about|version|enablePermissons) 79 | return 0 80 | ;; 81 | bind) 82 | _arguments \ 83 | "$_global_options[@]" \ 84 | "-type[one of 'ad', 'od', 'admitmac', 'centrify', or 'likewise']" \ 85 | "-computerID[the name that the computer will be assigned in the Active Directory domain]:computer ID" \ 86 | "-domain[the DNS name of the server that hosts the Active Directory domain]:domain" \ 87 | "-server[the DNS name or IP address of the AD or OD server]:server or ip address" \ 88 | "-username[the username that you will authenticate to Active Directory with to bind the computer]:user name" \ 89 | "-password[the password for the user that you will authenticate to Active Directory with to bind the computer]:password" \ 90 | "-ou[the OU (Organizational Unit) that the computers are stored in on the Active Directory server]:organizational unit" \ 91 | "-cache[create mobile account at login]" \ 92 | "-requireConfirmation[require confirmation before creating mobile account]" \ 93 | "-localHomes[use local home directories]" \ 94 | "-useUNCPath[use UNC Path from AD for network home location]" \ 95 | "-mountStyle[specify if the method that the user's home directory is mounted (AFP or SMB)]:afp or smb" \ 96 | "-defaultShell[specify the user's default shell]:shell path" \ 97 | "-uid[specify that attribute that stores the UID]: uid attribute" \ 98 | "-userGID[specify that attribute that stores the User's GID]: usergroup id" \ 99 | "-gid[specify that attribute that stores the GID]: user gid attribute" \ 100 | "-preferredServer[specify the DNS name of the server whose Active Directory domain you want used by default]:preferred server address" \ 101 | "-multipleDomains[allow users to authenticate from any domain in the forest]" \ 102 | "-adminGroups[specify groups that are have administrative privileges on the computer]:admin groups" \ 103 | "-encryptUsingSSL[bind to the OD server using SSL (OD Only)]" \ 104 | "-performSecureBind[perform a Secure, Two-Way bind to OD (OD Only)]" \ 105 | "-useForAuthentication[use this OD Server for Authentication (OD Only)]" \ 106 | "-useForContacts[use this OD Server for Contacts (OD Only)]" \ 107 | "-cachedLogins[the number of times a user can log in when not connected to a network. '0' disables cached logins. (ADmitMac only)]:number logins" \ 108 | "-homeFolderType[one of the following: "network" (default), "local", "either" and "mobile" (ADmitMac only)]:home folder type" \ 109 | "-mountNetworkHomeFolderOnDesktop[mount the user's home directory on their desktop (ADmitMac only)]" \ 110 | "-placeHomeFoldersInDirectory[Specify a folder where the home folders should be mounted (ADmitMac only)]:home folder dir" \ 111 | "-cachedCredentials[allow the credentials to be cached (ADmitMac only)]" \ 112 | "-addManagedDomainUserToAdminGroup[add the 'Managed By' domain user to the local admin group (ADmitMac only)]" \ 113 | "-usersOU[specify the OU that users should be looked up from (ADmitMac only)]:users OU" \ 114 | "-groupsOU[specify the OU that groups should be looked up from (ADmitMac Only)]:groups OU" \ 115 | "-printersOU[specify the OU that printers should be looked up from (ADmitMac Only)]:printers OU" \ 116 | "-sharedFoldersOU[specify the OU that Shared Folders should be looked up from (ADmitMac Only)]:shared folders OU" \ 117 | "-mapHomeDirectoryAttributeTo[specify that attribute that stores the Home Directory (ADmitMac only)]:home directory attribute" \ 118 | "-workstationMode[use without Centrify Administrator Console (Centrify Only)]" \ 119 | "-joinThisZone[specify the Zone in the Centrify Administrator Console (Centrify Only)]:zone" \ 120 | "-overwriteExistingRecord[overwrite the existing record (Centrify Only)]" \ 121 | "-doNotUpdatePAMAndDSConfig[Do not update PAM and Directory Service configuration (Centrify Only)]" \ 122 | && return 0 123 | ;; 124 | bless) 125 | _arguments \ 126 | "$_global_options[@]" \ 127 | "-target[the target drive that should be blessed]" \ 128 | "-setOF[set the drive as the current boot device]" \ 129 | "-setBoot[synonym for setOF]" \ 130 | "-bootargs[set the boot-args variable in Open Firmware]" \ 131 | "-bootfile[set the boot-file variable in Open Firmware]" \ 132 | "-bootdevice[set the boot-device variable in Open Firmware]" \ 133 | "-bootdirectory[set the boot-directory for an in-place upgrade]" \ 134 | && return 0 135 | ;; 136 | changePassword) 137 | _arguments \ 138 | "$_global_options[@]" \ 139 | "-username[the username for which to change the password]:user name" \ 140 | "-password[the new password for the user]:new password" \ 141 | "-passhash[the hash of the new password for the user]:password hash" \ 142 | "-oldPassword[the old/current password of the user]:old password" \ 143 | "-oldPasshash[the hash of the old/current password of the user]:old password hash" \ 144 | && return 0 145 | ;; 146 | checkJSSConnection) 147 | _arguments \ 148 | "$_global_options[@]" \ 149 | "-retry[the number of times the connection should be tested]:number of retries" \ 150 | && return 0 151 | ;; 152 | createAccount) 153 | _arguments \ 154 | "$_global_options[@]" \ 155 | "-username[the user's user name ]:user name" \ 156 | "-realname[the user's real name]:real name" \ 157 | "-password[the password of the user]:password" \ 158 | "-passhash[the hashed password of the user]:password hash" \ 159 | "-home[the location of the user's home directory]: home directory location" \ 160 | "-hint[the hint displayed to the user]:password hint" \ 161 | "-shell[the user's default shell]:default shell" \ 162 | "-picture[the user's picture for the Login window]:user picture" \ 163 | "-admin[this flag adds the user to the admin group]" \ 164 | "-hiddenUser[creates an account with a UID under 500 and hides it]" \ 165 | "-networkUser[creates an account with a UID over 1025]" \ 166 | "-secureSSH[modifies the group com.apple.ssh_access to restrict access to only this user]" \ 167 | && return 0 168 | ;; 169 | createHooks) 170 | _arguments \ 171 | "$_global_options[@]" \ 172 | "-url[the JSS URL]:jamf server url" \ 173 | "-verifySSLCert[valid values are 'always' (default), 'never', 'always_except_during_enrollment']:verify SSL cert value" \ 174 | "-server[the IP address or DNS name of the server]:ip address or dns" \ 175 | "-target[the target drive that the conf file should be created on]:target drive" \ 176 | && return 0 177 | ;; 178 | createHooks) 179 | _arguments \ 180 | "$_global_options[@]" \ 181 | "-target[the target drive used to create login/logout hooks]:target drive" \ 182 | "-policies[Checks for policies on login/logout]" \ 183 | "-mcx[Enforces MCX settings for the user that is logging in]" \ 184 | "-log[Creates a log entry in the JSS for the user who is logging in/out of the computer]" \ 185 | "-hideRestore[Hides the Restore partition if present]" \ 186 | "-background[Performs actions in the background during login]" \ 187 | "-displayStatus[Enables the progress display for login/logout]" \ 188 | && return 0 189 | ;; 190 | createSetupDone) 191 | _arguments \ 192 | "$_global_options[@]" \ 193 | "-target[the drive that the Setup Assistant will be suppressed on.]:target drive" \ 194 | "-suppressSetupAssistant[the Setup Assistant will not show on first login for any existing user accounts]" \ 195 | && return 0 196 | ;; 197 | createStartupItem) 198 | _arguments \ 199 | "$_global_options[@]" \ 200 | "-target[the target drive used to create the startup item]:target drive" \ 201 | "-log[the startup script logs the IP address to the JSS.]" \ 202 | "-policies[the startup item will check for policies in the JSS.]" \ 203 | "-ssh[the startup script will ensure that SSH is running.]" \ 204 | "-mcx[the startup script enforces System Level MCX settings.]" \ 205 | && return 0 206 | ;; 207 | deleteAccount) 208 | _arguments \ 209 | "$_global_options[@]" \ 210 | "-username[deletes the user's account]:username" \ 211 | "-backupTo[the .dmg file of the user's home directory]:path for dmg" \ 212 | "-deleteHomeDirectory[do not archive the user's home directory]" \ 213 | && return 0 214 | ;; 215 | deletePrinter) 216 | _arguments \ 217 | "$_global_options[@]" \ 218 | "-cupsName[the CUPS name of the printer]:cups printer name" \ 219 | && return 0 220 | ;; 221 | deleteSetupDone) 222 | _arguments \ 223 | "$_global_options[@]" \ 224 | "-target[the drive that the setup file will be delete from]:volume path" \ 225 | && return 0 226 | ;; 227 | displayMessage) 228 | _arguments \ 229 | "$_global_options[@]" \ 230 | "-message[the message to be displayed]:message" \ 231 | && return 0 232 | ;; 233 | enroll) 234 | _arguments \ 235 | "$_global_options[@]" \ 236 | "-prompt[prompt for JSS and SSH credentials]" \ 237 | "-invitation[uses an invitation ID for credentials instead of a user name and password]" \ 238 | "-noRecon[stops enroll from acquiring inventory]" \ 239 | "-noManage[stops enroll from enforcing the management framework]" \ 240 | "-noPolicy[stops enroll from checking for enrollment policies]" \ 241 | && return 0 242 | ;; 243 | fixByHostFiles|fixDocks|fixPermissions) 244 | _arguments \ 245 | "$_global_options[@]" \ 246 | "-target[the root of the drive or folder that will be updated]:volume" \ 247 | "-duplicate[]" \ 248 | && return 0 249 | ;; 250 | flushCaches) 251 | _arguments \ 252 | "$_global_options[@]" \ 253 | "-flushSystem[flush all System Caches]" \ 254 | "-flushUsers[flush all caches in the user's home directories]" \ 255 | && return 0 256 | ;; 257 | flushPolicyHistory) 258 | _arguments \ 259 | "$_global_options[@]" \ 260 | && return 0 261 | ;; 262 | getARDFields) 263 | _arguments \ 264 | "$_global_options[@]" \ 265 | "-target[the drive that the ARD fields will be display from]:path to volume" \ 266 | && return 0 267 | ;; 268 | getComputerName) 269 | _arguments \ 270 | "$_global_options[@]" \ 271 | "-target[the drive that the computer name will be displayed from]:path to volume" \ 272 | && return 0 273 | ;; 274 | help) 275 | _describe -t commands "jamf verb" _jamf_verbs \ 276 | && return 0 277 | ;; 278 | install) 279 | _arguments \ 280 | "$_global_options[@]" \ 281 | "-package[the filename of the package that will be installed]:package file name" \ 282 | "-path[the path to the package, not including the name of the package]:path to package" \ 283 | "-target[the drive that the package will be installed to]:target volume" \ 284 | "-fut[enable the Fill User Templates option]" \ 285 | "-feu[enable the Fill Existing Users option]" \ 286 | "-showProgress[displays the progress of the HTTP download and the progress of the installation process]" \ 287 | && return 0 288 | ;; 289 | installAllCached) 290 | _arguments \ 291 | "$_global_options[@]" \ 292 | && return 0 293 | ;; 294 | listUsers) 295 | _arguments \ 296 | "$_global_options[@]" \ 297 | "-showAll[shows system users with unique ID numbers less than 500]" \ 298 | "-sizes[calculates the size of a user’s home directory]" \ 299 | && return 0 300 | ;; 301 | log) 302 | _arguments \ 303 | "$_global_options[@]" \ 304 | "-action[the action to log (reboot, login or logout)]:action" \ 305 | "-username[the name of the user logging in or out]:username" \ 306 | && return 0 307 | ;; 308 | manage) 309 | _arguments \ 310 | "$_global_options[@]" \ 311 | && return 0 312 | ;; 313 | mapPrinter) 314 | _arguments \ 315 | "$_global_options[@]" \ 316 | "-id[the JSS ID of the printer]:jss id" \ 317 | "-cupsName[a CUPS compliant name]:printer name" \ 318 | "-location[the Location field of the printer]:printer location" \ 319 | "-displayName[the display name]:display name" \ 320 | "-deviceURI[the DeviceURI for the printer]:printer URI" \ 321 | "-path[the path to the PPDs folder]:path to PPDs folder" \ 322 | "-ppd[the full path to the PPD to use for the printer]:path to PPD" \ 323 | "-default[make this printer the default printer for all users on the system]" \ 324 | "-shared[make this printer the shared printer]" \ 325 | && return 0 326 | ;; 327 | mcx) 328 | _arguments \ 329 | "$_global_options[@]" \ 330 | "-username[the username of the account that Managed Preferences are being applied to]:username" \ 331 | && return 0 332 | ;; 333 | modifyDock) 334 | _arguments \ 335 | "$_global_options[@]" \ 336 | "-file[the file that contains the formatted dock items]:path to dock item file" \ 337 | "-id[the dock_item_id of the dock item on the JSS]:dock id" \ 338 | "-leaveRunning[the Dock process will not be restarted]" \ 339 | "-beginning[the item will be placed at the beginning (left side) of the Dock]" \ 340 | "-remove[the item will be removed instead of added]" \ 341 | && return 0 342 | ;; 343 | mount) 344 | _arguments \ 345 | "$_global_options[@]" \ 346 | "-url[mounts the specified URL]":mount uri \ 347 | "-server[the IP address or DNS name of the server]:server address" \ 348 | "-share[the name of the share you are mounting]:share name" \ 349 | "-type[the type of file share (afp or smb)]:type" \ 350 | "-username[user acccount to access the share with]:username" \ 351 | "-password[password to access the share with]:password" \ 352 | "-passhash[the hashed password to access the share with]:password hash" \ 353 | "-port[specify a non standard port for AFP]:port" \ 354 | "-workgroup[the workgroup or domain for the SMB type]:workgroup" \ 355 | "-visible[specify that the share should be visible in the Finder]" \ 356 | && return 0 357 | ;; 358 | policy) 359 | _arguments \ 360 | "$_global_options[@]" \ 361 | "(-event -trigger -action)"{-event,-trigger,-action}"[the event or trigger for the policy]:trigger name" \ 362 | "-username[the username to check for policies for]" \ 363 | "-id[the ID of the policy to be executed]" \ 364 | "-forceNoRecon[prevents computers from submitting inventory update when a policy is configured to update inventory]" \ 365 | && return 0 366 | ;; 367 | reboot) 368 | _arguments \ 369 | "$_global_options[@]" \ 370 | "-minutes[the minutes until the machine should reboot]:minutes" \ 371 | "-message[the message to display to any logged in users]:message" \ 372 | "-startTimerImmediately[start the restart timer immediately without requiring the user to acknowledge the restart message]" \ 373 | "-background[background this process (don't wait until the reboot to exit)]" \ 374 | "-immediately[reboot now without warning users]" \ 375 | && return 0 376 | ;; 377 | recon) 378 | _arguments \ 379 | "$_global_options[@]" \ 380 | "-saveFormTo[saves the contents of the HTTP form to a file]:filepath" \ 381 | "-assetTag[the asset tag of the computer]:asset tag" \ 382 | "-endUsername[the user name of the primary user]:primary user shortname" \ 383 | "-realname[the real name of the primary user]:primary user full name" \ 384 | "-email[the email address of the primary user]:primary user email address" \ 385 | "-position[the position (job title) of the primary user]:primary user job title" \ 386 | "-building[the text representation of a building in the JSS]:building" \ 387 | "-department[the text representation of a department in the JSS]:deparment" \ 388 | "-phone[the phone number of the primary user]:primary user phone number" \ 389 | "-room[the room that the computer is in]:room" \ 390 | "-ldapServerID[the JSS ID of the LDAP server to which the primary user belongs]:ldap server ID" \ 391 | "-userID[the user ID of the primary user's account in the LDAP server]:user ID in JSS" \ 392 | "-sshUsername[a username that is used to connect to the computer over SSH]:ssh account name" \ 393 | "-sshPassword[a password that is used to connect to the computer over SSH]:ssh password" \ 394 | "-sshPasshash[a hashed copy of a password that is used to connect to the computer over SSH]:ssh password hash" \ 395 | && return 0 396 | ;; 397 | removeFramework) 398 | _arguments \ 399 | "$_global_options[@]" \ 400 | && return 0 401 | ;; 402 | removeSWUSettings) 403 | _arguments \ 404 | "$_global_options[@]" \ 405 | && return 0 406 | ;; 407 | resetPassword) 408 | _arguments \ 409 | "$_global_options[@]" \ 410 | "-username[the username for which to reset the password]:username" \ 411 | "-password[the new password for the user]:new password" \ 412 | "-passhash[the hash of the new password for the user]: new passhash" \ 413 | && return 0 414 | ;; 415 | runScript) 416 | _arguments \ 417 | "$_global_options[@]" \ 418 | "-script[the file name of the script to run]:file name" \ 419 | "-path[the path to the script]:path to script" \ 420 | "-computerName[the name of the computer to be passed to the script]:computer name" \ 421 | "-target[the target drive to be passed to the script]:target drive" \ 422 | "-username[the username to be passed to the script]:user name" \ 423 | "-p"{1..8}"[the parameters to be passed to the script]:parameter" \ 424 | && return 0 425 | ;; 426 | runSoftwareUpdate) 427 | _arguments \ 428 | "$_global_options[@]" \ 429 | "-server[the server which the Software Update service should look to]:software update server address" \ 430 | "-setPrefOnly[point SWU to the server, but do not run]" \ 431 | "-fromApple[run Software Update from Apple, not a hosted server]" \ 432 | && return 0 433 | ;; 434 | setARDFields) 435 | _arguments \ 436 | "$_global_options[@]" \ 437 | "-target[the target drive to set the fields on]:target volume" \ 438 | "-"{1..4}"[the field for Apple Remote Desktop]" \ 439 | && return 0 440 | ;; 441 | setComputerName) 442 | _arguments \ 443 | "$_global_options[@]" \ 444 | "-target[The target drive to set the name on]:target volume" \ 445 | "-name[the new name for the computer]:new computer name" \ 446 | "-useMACAddress[generate the name using the MAC Address]" \ 447 | "-useSerialNumber[generate the name using the Serial Number]" \ 448 | "-prefix[add this prefix to the MAC Address or Serial Number]:prefix" \ 449 | "-suffix[add this suffix to the MAC Address or Serial Number]:suffix" \ 450 | "-fromFile[The path to a CSV file containing the computer's MAC Address or Serial Number followed by the desired name]:path to csv file" \ 451 | && return 0 452 | ;; 453 | setHomePage) 454 | _arguments \ 455 | "$_global_options[@]" \ 456 | "-homepage[the URL for the homepage]:homepage url" \ 457 | "-feu[set the homepage for existing users]" \ 458 | "-fut[set the homepage in the User Templates]" \ 459 | "-username[set the homepage only for this user]:username" \ 460 | "-ffmstone[specify the milestone version for FireFox]:firefox milestone" \ 461 | "-mozmstone[specify the milestone version for Mozilla (Netscape)]:mozilla milestone" \ 462 | "-removeDownloadLocation[remove the default download location]" \ 463 | "-skipIE[do not set the homepage for Internet Explorer]" \ 464 | "-skipFirefox[do not set the homepage for Firefox]" \ 465 | "-skipMozilla[do not set the homepage for Mozilla based browsers (Netscape)]" \ 466 | "-skipSafari[do not set the homepage for Safari]" \ 467 | && return 0 468 | ;; 469 | setOFP) 470 | _arguments \ 471 | "$_global_options[@]" \ 472 | "-mode[the security-mode to set in Open Firmware (none, command, full)]:security mode" \ 473 | "-passhash[the hash to set the security-password to in Open Firmware]:password hash" \ 474 | "-password[the password to set the security-password to in Open Firmware]:password" \ 475 | && return 0 476 | ;; 477 | startSSH) 478 | _arguments \ 479 | "$_global_options[@]" \ 480 | && return 0 481 | ;; 482 | uninstall) 483 | _arguments \ 484 | "$_global_options[@]" \ 485 | "-target[the target drive to uninstall the package from]:target volume" \ 486 | "-id[the ID of the package in the JSS]:jss package id" \ 487 | "-fut[remove any files from the package that are in the User Templates]" \ 488 | "-feu[remove any files from the package that are installed in a user's home directory]" \ 489 | && return 0 490 | ;; 491 | unmountServer) 492 | _arguments \ 493 | "$_global_options[@]" \ 494 | "-mountPoint[the path to the share you want to unmount]:path to mount" \ 495 | && return 0 496 | ;; 497 | updatePrebindings) 498 | _arguments \ 499 | "$_global_options[@]" \ 500 | "-target[the path to the location you want to update prebindings for]:target volume" \ 501 | && return 0 502 | ;; 503 | *) 504 | _message "unknown jamf verb: $words[1]" 505 | _default 506 | ;; 507 | esac 508 | return 1 509 | } -------------------------------------------------------------------------------- /completions/_plutil: -------------------------------------------------------------------------------- 1 | #compdef plutil 2 | 3 | # plutil completion added in zsh 5.5 4 | # https://github.com/zsh-users/zsh/blob/f9e9dce5443f323b340303596406f9d3ce11d23a/Completion/Darwin/Command/_plutil 5 | # only load this on earlier zsh versions 6 | if [[ $ZSH_VERSION < "5.5" ]]; then 7 | _plutil() { 8 | _arguments \ 9 | "-help[Show the usage information for the command and exit]" \ 10 | "-p[Print the property list in human-readable fashion]" \ 11 | "-lint[Check the named property list files for syntax errors]" \ 12 | "-convert[Convert the named file to the indicated format (xml1, binary1, json) and write back to the file system]:format:(xml1 binary1 json)" \ 13 | "--[Specifies that all further arguments are file names]" \ 14 | "-s[Don't print anything on success]" \ 15 | "-r[For JSON, add whitespace and indention to make the output more human-readable]" \ 16 | "-o[Specify an alternate path name for the result of the -convert operation]:o" \ 17 | "-e[Specify an alternate extension for converted files, and the output file names are otherwise the same]:extension" \ 18 | "*::filename:_files" 19 | } 20 | fi 21 | -------------------------------------------------------------------------------- /completions/_project: -------------------------------------------------------------------------------- 1 | #compdef project 2 | 3 | _project() { 4 | _arguments \ 5 | "*:project folder name:_files -/ -W $PROJECTS_DIR/ -S ''" 6 | } -------------------------------------------------------------------------------- /completions/_see: -------------------------------------------------------------------------------- 1 | #compdef see 2 | 3 | _see() { 4 | _arguments -s -S \ 5 | "(-b --background)"{-b,--background}"[keep SubEthaEdit in the background or launch it in the background]" \ 6 | "(-e --encoding)"{-e,--encoding}"[specify the internet name of an encoding to open the specified file(s) using that encoding]":encoding \ 7 | "(-g --goto)"{-g,--goto}"[set the selection to the specified line, column and length]:line number" \ 8 | "(-h --help)"{-h,--help}"[display usage information and exit]" \ 9 | "(-j --job-description)"{-j,--job-description}"[specify a string describing the context in which the command is used]":jobdescription \ 10 | "(-l --launch)"{-l,--launch}"[launch SubEthaEdit or activate it, if it's already running]" \ 11 | "(-m --mode)"{-m,--mode}"[specify the identifier of a mode to open the specified file(s) using that mode]":identifier \ 12 | "(-o --open-in)"{-o,--open-in}"[specify in which container the files should be openend; tabs, windows or new-window]:target:(tabs windows new-window)" \ 13 | "(-p --print)"{-p,--print}"[print the specified file(s) on the default printer]" \ 14 | "(-r --resume)"{-r,--resume}"[bring the application which was in the foreground when the see command was invoked to the foreground]" \ 15 | "(-d --pipe-dirty)"{-d,--pipe-dirty}"[make the document containing the text from stdin dirty so it shows a dialog on close]" \ 16 | "(-t --pipe-title)"{-t,--pipe-title}"[specify a string which should be used as the window title for the document]:window title" \ 17 | "(-v --version)"{-v,--version}"[display version information and exit]" \ 18 | "(-w --wait)"{-w,--wait}"[wait until all specified files have been closed in SubEthaEdit]" \ 19 | "*::filename:_files" 20 | } -------------------------------------------------------------------------------- /completions/_softwareupdate: -------------------------------------------------------------------------------- 1 | #compdef softwareupdate 2 | 3 | _softwareupdate_ignored_update_name() { 4 | if [[ -z "$_softwareupdate_ignored_updates" ]]; then 5 | local res="$(_call_program pkgs softwareupdate --ignored)" 6 | _softwareupdate_ignored_updates=("${(Qs/, /)${${res#Current ignored updates: \(}%\)}}") 7 | fi 8 | if (( ${#_softwareupdate_ignored_updates} > 0 )); then 9 | _wanted pkgs expl "ignored package" compadd -a _softwareupdate_ignored_updates && return 0 10 | fi 11 | return 1 12 | } 13 | 14 | _softwareupdate_update_name() { 15 | local name line 16 | if [[ -z "$_softwareupdate_updates" ]]; then 17 | _softwareupdate_updates=() 18 | for line in ${(f)"$(_call_program pkgs softwareupdate --list --no-scan)"}; do 19 | if [[ $line == ' '* ]]; then 20 | name="${line# ? }" 21 | elif [[ -n "$name" ]]; then 22 | _softwareupdate_updates+=("$name:${line# }") 23 | name="" 24 | fi 25 | done 26 | fi 27 | if (( ${#_softwareupdate_updates} > 0 )); then 28 | _describe -t pkgs "update name" _softwareupdate_updates && return 0 29 | fi 30 | return 1 31 | } 32 | 33 | _softwareupdate_fullinstaller_version() { 34 | local name line 35 | if [[ -z "$_softwareupdate_installer_versions" ]]; then 36 | _softwareupdate_installer_versions=() 37 | for line in ${(f)"$(_call_program pkgs softwareupdate --list-full-installers --no-scan)"}; do 38 | if [[ $line == "* "* ]]; then 39 | name=${${line#*Version: }%, Size*} 40 | _softwareupdate_installer_versions+=("$name") 41 | fi 42 | done 43 | fi 44 | if (( ${#_softwareupdate_installer_versions} > 0 )); then 45 | _describe -t pkgs "installer version" _softwareupdate_installer_versions && return 0 46 | fi 47 | return 1 48 | } 49 | 50 | _softwareupdate() { 51 | local context state line expl 52 | typeset -A opt_args 53 | 54 | _arguments -R \ 55 | '(-h --help -l --list)-q[quiet mode]' \ 56 | {-l,--list}'[list all available updates]:*:' \ 57 | {-d,--download}'[Download only]:*:' \ 58 | {-e,--cancel-download}'[cancel a download]' \ 59 | '--background[trigger a background scan and update operation]' \ 60 | {-i,--install}'[install (requires root)]:*: :->install' \ 61 | '--list-full-installers[List the available macOS Installers]' \ 62 | '--fetch-full-installer[install the latest macOS Installer]:*: :->fetch' \ 63 | '--install-rosetta[Install Rosetta 2]' \ 64 | '--history[show the install history]:*: :->history' \ 65 | '--schedule[scheduler preferences (per-user)]:automatic checking:(on off)' \ 66 | {-h,--help}'[print command usage]:*:' && return 0 67 | 68 | case "$state" in 69 | install) 70 | _arguments \ 71 | '(* -a --all)'{-a,--all}'[all available active updates]' \ 72 | '(* -r --req)'{-r,--req}'[all required active updates]' \ 73 | '(* -R --restart)'{-R,--restart}'[automatically restart (or shut down) if required to complete installation]' \ 74 | '--os-only[Only OS updates]' \ 75 | '--safari-only[Only Safari updates]' \ 76 | '--stdinpass[Password to authenticate as an owner. Apple Silicon only.]' \ 77 | '--user[Local username to authenticate as an owner. Apple Silicon only.]' \ 78 | '*:update name:_softwareupdate_update_name' && return 0 79 | ;; 80 | fetch) 81 | _arguments \ 82 | '--full-installer-version:installer version:_softwareupdate_fullinstaller_version' \ 83 | && return 0 84 | ;; 85 | history) 86 | _arguments \ 87 | '--all[include all processes in history (including App installs)]' \ 88 | && return 0 89 | ;; 90 | esac 91 | return 1 92 | } 93 | 94 | _softwareupdate "$@" 95 | -------------------------------------------------------------------------------- /completions/_swift: -------------------------------------------------------------------------------- 1 | #compdef swift 2 | local context state state_descr line 3 | _swift_commandname=$words[1] 4 | typeset -A opt_args 5 | 6 | _swift() { 7 | integer ret=1 8 | local -a args 9 | args+=( 10 | '(-h --help)'{-h,--help}'[Show help information.]' 11 | '(-): :->command' 12 | '(-)*:: :->arg' 13 | ) 14 | _arguments -w -s -S $args[@] && ret=0 15 | case $state in 16 | (command) 17 | local subcommands 18 | subcommands=( 19 | 'run:Build and run an executable product' 20 | 'build:Build sources into binary products' 21 | 'test:Build and run tests' 22 | 'package:Perform operations on Swift packages' 23 | 'help:Show subcommand help information.' 24 | ) 25 | _describe "subcommand" subcommands 26 | ;; 27 | (arg) 28 | case ${words[1]} in 29 | (run) 30 | _swift_run 31 | ;; 32 | (build) 33 | _swift_build 34 | ;; 35 | (test) 36 | _swift_test 37 | ;; 38 | (package) 39 | _swift_package 40 | ;; 41 | (help) 42 | _swift_help 43 | ;; 44 | esac 45 | ;; 46 | esac 47 | 48 | return ret 49 | } 50 | 51 | _swift_run() { 52 | integer ret=1 53 | local -a args 54 | args+=( 55 | '--package-path[Specify the package path to operate on (default current directory). This changes the working directory before any other operation]:package-path:_files -/' 56 | '--cache-path[Specify the shared cache directory path]:cache-path:_files -/' 57 | '--config-path[Specify the shared configuration directory path]:config-path:_files -/' 58 | '--security-path[Specify the shared security directory path]:security-path:_files -/' 59 | '--scratch-path[Specify a custom scratch directory path (default .build)]:scratch-path:_files -/' 60 | '--swift-sdks-path[Path to the directory containing installed Swift SDKs]:swift-sdks-path:_files -/' 61 | '--pkg-config-path[Specify alternative path to search for pkg-config `.pc` files. Use the option multiple times to 62 | specify more than one path.]:pkg-config-path:_files -/' 63 | '--enable-dependency-cache[Use a shared cache when fetching dependencies]' 64 | '--disable-dependency-cache[Use a shared cache when fetching dependencies]' 65 | '--enable-build-manifest-caching' 66 | '--disable-build-manifest-caching' 67 | '--manifest-cache[Caching mode of Package.swift manifests (shared: shared cache, local: package'"'"'s build directory, none: disabled]:manifest-cache:' 68 | '(--verbose -v)'{--verbose,-v}'[Increase verbosity to include informational output]' 69 | '(--very-verbose --vv)'{--very-verbose,--vv}'[Increase verbosity to include debug output]' 70 | '(--quiet -q)'{--quiet,-q}'[Decrease verbosity to only include error output.]' 71 | '--disable-sandbox[Disable using the sandbox when executing subprocesses]' 72 | '--netrc[Use netrc file even in cases where other credential stores are preferred]' 73 | '--enable-netrc[Load credentials from a netrc file]' 74 | '--disable-netrc[Load credentials from a netrc file]' 75 | '--netrc-file[Specify the netrc file path]:netrc-file:_files' 76 | '--enable-keychain[Search credentials in macOS keychain]' 77 | '--disable-keychain[Search credentials in macOS keychain]' 78 | '--resolver-fingerprint-checking:resolver-fingerprint-checking:' 79 | '--resolver-signing-entity-checking:resolver-signing-entity-checking:' 80 | '--enable-signature-validation[Validate signature of a signed package release downloaded from registry]' 81 | '--disable-signature-validation[Validate signature of a signed package release downloaded from registry]' 82 | '--enable-prefetching' 83 | '--disable-prefetching' 84 | '(--force-resolved-versions --disable-automatic-resolution --only-use-versions-from-resolved-file)'{--force-resolved-versions,--disable-automatic-resolution,--only-use-versions-from-resolved-file}'[Only use versions from the Package.resolved file and fail resolution if it is out-of-date]' 85 | '--skip-update[Skip updating dependencies from their remote during a resolution]' 86 | '--disable-scm-to-registry-transformation[disable source control to registry transformation]' 87 | '--use-registry-identity-for-scm[look up source control dependencies in the registry and use their registry identity when possible to help deduplicate across the two origins]' 88 | '--replace-scm-with-registry[look up source control dependencies in the registry and use the registry to retrieve them instead of source control when possible]' 89 | '--default-registry-url[Default registry URL to use, instead of the registries.json configuration file]:default-registry-url:' 90 | '(--configuration -c)'{--configuration,-c}'[Build with configuration]:configuration:(debug release)' 91 | '-Xcc[Pass flag through to all C compiler invocations]:Xcc:' 92 | '-Xswiftc[Pass flag through to all Swift compiler invocations]:Xswiftc:' 93 | '-Xlinker[Pass flag through to all linker invocations]:Xlinker:' 94 | '-Xcxx[Pass flag through to all C++ compiler invocations]:Xcxx:' 95 | '--triple:triple:' 96 | '--sdk:sdk:_files -/' 97 | '--toolchain:toolchain:_files -/' 98 | '--swift-sdk[Filter for selecting a specific Swift SDK to build with]:swift-sdk:' 99 | '--sanitize[Turn on runtime checks for erroneous behavior, possible values: address, thread, undefined, scudo]:sanitize:(address thread undefined scudo)' 100 | '--auto-index-store[Enable or disable indexing-while-building feature]' 101 | '--enable-index-store[Enable or disable indexing-while-building feature]' 102 | '--disable-index-store[Enable or disable indexing-while-building feature]' 103 | '--enable-parseable-module-interfaces' 104 | '(--jobs -j)'{--jobs,-j}'[The number of jobs to spawn in parallel during the build process]:jobs:' 105 | '--use-integrated-swift-driver' 106 | '--explicit-target-dependency-import-check:explicit-target-dependency-import-check:' 107 | '--experimental-explicit-module-build' 108 | '--build-system:build-system:(native xcode)' 109 | '-debug-info-format:debug-info-format:' 110 | '--enable-dead-strip[Disable/enable dead code stripping by the linker]' 111 | '--disable-dead-strip[Disable/enable dead code stripping by the linker]' 112 | '--disable-local-rpath[Disable adding $ORIGIN/@loader_path to the rpath by default]' 113 | '--repl[Launch Swift REPL for the package]' 114 | '--debugger[Launch the executable in a debugger session]' 115 | '--run[Launch the executable with the provided arguments]' 116 | '--skip-build[Skip building the executable product]' 117 | '--build-tests[Build both source and test targets]' 118 | ':executable:{local -a list; list=(${(f)"$(swift package completion-tool list-executables)"}); _describe '''' list}' 119 | ':arguments:' 120 | '--version[Show the version.]' 121 | '(-help -h --help)'{-help,-h,--help}'[Show help information.]' 122 | ) 123 | _arguments -w -s -S $args[@] && ret=0 124 | 125 | return ret 126 | } 127 | 128 | _swift_build() { 129 | integer ret=1 130 | local -a args 131 | args+=( 132 | '--package-path[Specify the package path to operate on (default current directory). This changes the working directory before any other operation]:package-path:_files -/' 133 | '--cache-path[Specify the shared cache directory path]:cache-path:_files -/' 134 | '--config-path[Specify the shared configuration directory path]:config-path:_files -/' 135 | '--security-path[Specify the shared security directory path]:security-path:_files -/' 136 | '--scratch-path[Specify a custom scratch directory path (default .build)]:scratch-path:_files -/' 137 | '--swift-sdks-path[Path to the directory containing installed Swift SDKs]:swift-sdks-path:_files -/' 138 | '--pkg-config-path[Specify alternative path to search for pkg-config `.pc` files. Use the option multiple times to 139 | specify more than one path.]:pkg-config-path:_files -/' 140 | '--enable-dependency-cache[Use a shared cache when fetching dependencies]' 141 | '--disable-dependency-cache[Use a shared cache when fetching dependencies]' 142 | '--enable-build-manifest-caching' 143 | '--disable-build-manifest-caching' 144 | '--manifest-cache[Caching mode of Package.swift manifests (shared: shared cache, local: package'"'"'s build directory, none: disabled]:manifest-cache:' 145 | '(--verbose -v)'{--verbose,-v}'[Increase verbosity to include informational output]' 146 | '(--very-verbose --vv)'{--very-verbose,--vv}'[Increase verbosity to include debug output]' 147 | '(--quiet -q)'{--quiet,-q}'[Decrease verbosity to only include error output.]' 148 | '--disable-sandbox[Disable using the sandbox when executing subprocesses]' 149 | '--netrc[Use netrc file even in cases where other credential stores are preferred]' 150 | '--enable-netrc[Load credentials from a netrc file]' 151 | '--disable-netrc[Load credentials from a netrc file]' 152 | '--netrc-file[Specify the netrc file path]:netrc-file:_files' 153 | '--enable-keychain[Search credentials in macOS keychain]' 154 | '--disable-keychain[Search credentials in macOS keychain]' 155 | '--resolver-fingerprint-checking:resolver-fingerprint-checking:' 156 | '--resolver-signing-entity-checking:resolver-signing-entity-checking:' 157 | '--enable-signature-validation[Validate signature of a signed package release downloaded from registry]' 158 | '--disable-signature-validation[Validate signature of a signed package release downloaded from registry]' 159 | '--enable-prefetching' 160 | '--disable-prefetching' 161 | '(--force-resolved-versions --disable-automatic-resolution --only-use-versions-from-resolved-file)'{--force-resolved-versions,--disable-automatic-resolution,--only-use-versions-from-resolved-file}'[Only use versions from the Package.resolved file and fail resolution if it is out-of-date]' 162 | '--skip-update[Skip updating dependencies from their remote during a resolution]' 163 | '--disable-scm-to-registry-transformation[disable source control to registry transformation]' 164 | '--use-registry-identity-for-scm[look up source control dependencies in the registry and use their registry identity when possible to help deduplicate across the two origins]' 165 | '--replace-scm-with-registry[look up source control dependencies in the registry and use the registry to retrieve them instead of source control when possible]' 166 | '--default-registry-url[Default registry URL to use, instead of the registries.json configuration file]:default-registry-url:' 167 | '(--configuration -c)'{--configuration,-c}'[Build with configuration]:configuration:(debug release)' 168 | '-Xcc[Pass flag through to all C compiler invocations]:Xcc:' 169 | '-Xswiftc[Pass flag through to all Swift compiler invocations]:Xswiftc:' 170 | '-Xlinker[Pass flag through to all linker invocations]:Xlinker:' 171 | '-Xcxx[Pass flag through to all C++ compiler invocations]:Xcxx:' 172 | '--triple:triple:' 173 | '--sdk:sdk:_files -/' 174 | '--toolchain:toolchain:_files -/' 175 | '--swift-sdk[Filter for selecting a specific Swift SDK to build with]:swift-sdk:' 176 | '--sanitize[Turn on runtime checks for erroneous behavior, possible values: address, thread, undefined, scudo]:sanitize:(address thread undefined scudo)' 177 | '--auto-index-store[Enable or disable indexing-while-building feature]' 178 | '--enable-index-store[Enable or disable indexing-while-building feature]' 179 | '--disable-index-store[Enable or disable indexing-while-building feature]' 180 | '--enable-parseable-module-interfaces' 181 | '(--jobs -j)'{--jobs,-j}'[The number of jobs to spawn in parallel during the build process]:jobs:' 182 | '--use-integrated-swift-driver' 183 | '--explicit-target-dependency-import-check:explicit-target-dependency-import-check:' 184 | '--experimental-explicit-module-build' 185 | '--build-system:build-system:(native xcode)' 186 | '-debug-info-format:debug-info-format:' 187 | '--enable-dead-strip[Disable/enable dead code stripping by the linker]' 188 | '--disable-dead-strip[Disable/enable dead code stripping by the linker]' 189 | '--disable-local-rpath[Disable adding $ORIGIN/@loader_path to the rpath by default]' 190 | '--build-tests[Build both source and test targets]' 191 | '--enable-code-coverage[Enable code coverage]' 192 | '--disable-code-coverage[Enable code coverage]' 193 | '--show-bin-path[Print the binary output path]' 194 | '--print-manifest-job-graph[Write the command graph for the build manifest as a graphviz file]' 195 | '--target[Build the specified target]:target:' 196 | '--product[Build the specified product]:product:' 197 | '--enable-xctest[Enable support for XCTest]' 198 | '--disable-xctest[Enable support for XCTest]' 199 | '--enable-swift-testing[Enable support for Swift Testing]' 200 | '--disable-swift-testing[Enable support for Swift Testing]' 201 | '--static-swift-stdlib[Link Swift stdlib statically]' 202 | '--no-static-swift-stdlib[Link Swift stdlib statically]' 203 | '--version[Show the version.]' 204 | '(-help -h --help)'{-help,-h,--help}'[Show help information.]' 205 | ) 206 | _arguments -w -s -S $args[@] && ret=0 207 | 208 | return ret 209 | } 210 | 211 | _swift_test() { 212 | integer ret=1 213 | local -a args 214 | args+=( 215 | '--package-path[Specify the package path to operate on (default current directory). This changes the working directory before any other operation]:package-path:_files -/' 216 | '--cache-path[Specify the shared cache directory path]:cache-path:_files -/' 217 | '--config-path[Specify the shared configuration directory path]:config-path:_files -/' 218 | '--security-path[Specify the shared security directory path]:security-path:_files -/' 219 | '--scratch-path[Specify a custom scratch directory path (default .build)]:scratch-path:_files -/' 220 | '--swift-sdks-path[Path to the directory containing installed Swift SDKs]:swift-sdks-path:_files -/' 221 | '--pkg-config-path[Specify alternative path to search for pkg-config `.pc` files. Use the option multiple times to 222 | specify more than one path.]:pkg-config-path:_files -/' 223 | '--enable-dependency-cache[Use a shared cache when fetching dependencies]' 224 | '--disable-dependency-cache[Use a shared cache when fetching dependencies]' 225 | '--enable-build-manifest-caching' 226 | '--disable-build-manifest-caching' 227 | '--manifest-cache[Caching mode of Package.swift manifests (shared: shared cache, local: package'"'"'s build directory, none: disabled]:manifest-cache:' 228 | '(--verbose -v)'{--verbose,-v}'[Increase verbosity to include informational output]' 229 | '(--very-verbose --vv)'{--very-verbose,--vv}'[Increase verbosity to include debug output]' 230 | '(--quiet -q)'{--quiet,-q}'[Decrease verbosity to only include error output.]' 231 | '--disable-sandbox[Disable using the sandbox when executing subprocesses]' 232 | '--netrc[Use netrc file even in cases where other credential stores are preferred]' 233 | '--enable-netrc[Load credentials from a netrc file]' 234 | '--disable-netrc[Load credentials from a netrc file]' 235 | '--netrc-file[Specify the netrc file path]:netrc-file:_files' 236 | '--enable-keychain[Search credentials in macOS keychain]' 237 | '--disable-keychain[Search credentials in macOS keychain]' 238 | '--resolver-fingerprint-checking:resolver-fingerprint-checking:' 239 | '--resolver-signing-entity-checking:resolver-signing-entity-checking:' 240 | '--enable-signature-validation[Validate signature of a signed package release downloaded from registry]' 241 | '--disable-signature-validation[Validate signature of a signed package release downloaded from registry]' 242 | '--enable-prefetching' 243 | '--disable-prefetching' 244 | '(--force-resolved-versions --disable-automatic-resolution --only-use-versions-from-resolved-file)'{--force-resolved-versions,--disable-automatic-resolution,--only-use-versions-from-resolved-file}'[Only use versions from the Package.resolved file and fail resolution if it is out-of-date]' 245 | '--skip-update[Skip updating dependencies from their remote during a resolution]' 246 | '--disable-scm-to-registry-transformation[disable source control to registry transformation]' 247 | '--use-registry-identity-for-scm[look up source control dependencies in the registry and use their registry identity when possible to help deduplicate across the two origins]' 248 | '--replace-scm-with-registry[look up source control dependencies in the registry and use the registry to retrieve them instead of source control when possible]' 249 | '--default-registry-url[Default registry URL to use, instead of the registries.json configuration file]:default-registry-url:' 250 | '(--configuration -c)'{--configuration,-c}'[Build with configuration]:configuration:(debug release)' 251 | '-Xcc[Pass flag through to all C compiler invocations]:Xcc:' 252 | '-Xswiftc[Pass flag through to all Swift compiler invocations]:Xswiftc:' 253 | '-Xlinker[Pass flag through to all linker invocations]:Xlinker:' 254 | '-Xcxx[Pass flag through to all C++ compiler invocations]:Xcxx:' 255 | '--triple:triple:' 256 | '--sdk:sdk:_files -/' 257 | '--toolchain:toolchain:_files -/' 258 | '--swift-sdk[Filter for selecting a specific Swift SDK to build with]:swift-sdk:' 259 | '--sanitize[Turn on runtime checks for erroneous behavior, possible values: address, thread, undefined, scudo]:sanitize:(address thread undefined scudo)' 260 | '--auto-index-store[Enable or disable indexing-while-building feature]' 261 | '--enable-index-store[Enable or disable indexing-while-building feature]' 262 | '--disable-index-store[Enable or disable indexing-while-building feature]' 263 | '--enable-parseable-module-interfaces' 264 | '(--jobs -j)'{--jobs,-j}'[The number of jobs to spawn in parallel during the build process]:jobs:' 265 | '--use-integrated-swift-driver' 266 | '--explicit-target-dependency-import-check:explicit-target-dependency-import-check:' 267 | '--experimental-explicit-module-build' 268 | '--build-system:build-system:(native xcode)' 269 | '-debug-info-format:debug-info-format:' 270 | '--enable-dead-strip[Disable/enable dead code stripping by the linker]' 271 | '--disable-dead-strip[Disable/enable dead code stripping by the linker]' 272 | '--disable-local-rpath[Disable adding $ORIGIN/@loader_path to the rpath by default]' 273 | '--skip-build[Skip building the test target]' 274 | '--enable-xctest[Enable support for XCTest]' 275 | '--disable-xctest[Enable support for XCTest]' 276 | '--enable-swift-testing[Enable support for Swift Testing]' 277 | '--disable-swift-testing[Enable support for Swift Testing]' 278 | '--parallel[Run the tests in parallel.]' 279 | '--no-parallel[Run the tests in parallel.]' 280 | '--num-workers[Number of tests to execute in parallel.]:num-workers:' 281 | '(--list-tests -l)'{--list-tests,-l}'[Lists test methods in specifier format]' 282 | '(--show-codecov-path --show-code-coverage-path --show-coverage-path)'{--show-codecov-path,--show-code-coverage-path,--show-coverage-path}'[Print the path of the exported code coverage JSON file]' 283 | '(-s --specifier)'{-s,--specifier}':specifier:' 284 | '--filter[Run test cases matching regular expression, Format: . or ./]:filter:' 285 | '--skip[Skip test cases matching regular expression, Example: --skip PerformanceTests]:skip:' 286 | '--xunit-output[Path where the xUnit xml file should be generated.]:xunit-output:_files -/' 287 | '--enable-testable-imports[Enable or disable testable imports. Enabled by default.]' 288 | '--disable-testable-imports[Enable or disable testable imports. Enabled by default.]' 289 | '--enable-code-coverage[Enable code coverage]' 290 | '--disable-code-coverage[Enable code coverage]' 291 | '--version[Show the version.]' 292 | '(-help -h --help)'{-help,-h,--help}'[Show help information.]' 293 | '(-): :->command' 294 | '(-)*:: :->arg' 295 | ) 296 | _arguments -w -s -S $args[@] && ret=0 297 | case $state in 298 | (command) 299 | local subcommands 300 | subcommands=( 301 | 'list:Lists test methods in specifier format' 302 | 'last:' 303 | ) 304 | _describe "subcommand" subcommands 305 | ;; 306 | (arg) 307 | case ${words[1]} in 308 | (list) 309 | _swift_test_list 310 | ;; 311 | (last) 312 | _swift_test_last 313 | ;; 314 | esac 315 | ;; 316 | esac 317 | 318 | return ret 319 | } 320 | 321 | _swift_test_list() { 322 | integer ret=1 323 | local -a args 324 | args+=( 325 | '--skip-build[Skip building the test target]' 326 | '--enable-xctest[Enable support for XCTest]' 327 | '--disable-xctest[Enable support for XCTest]' 328 | '--enable-swift-testing[Enable support for Swift Testing]' 329 | '--disable-swift-testing[Enable support for Swift Testing]' 330 | '--version[Show the version.]' 331 | '(-help -h --help)'{-help,-h,--help}'[Show help information.]' 332 | ) 333 | _arguments -w -s -S $args[@] && ret=0 334 | 335 | return ret 336 | } 337 | 338 | _swift_test_last() { 339 | integer ret=1 340 | local -a args 341 | args+=( 342 | '--version[Show the version.]' 343 | '(-help -h --help)'{-help,-h,--help}'[Show help information.]' 344 | ) 345 | _arguments -w -s -S $args[@] && ret=0 346 | 347 | return ret 348 | } 349 | 350 | _swift_package() { 351 | integer ret=1 352 | local -a args 353 | args+=( 354 | '--package-path[Specify the package path to operate on (default current directory). This changes the working directory before any other operation]:package-path:_files -/' 355 | '--cache-path[Specify the shared cache directory path]:cache-path:_files -/' 356 | '--config-path[Specify the shared configuration directory path]:config-path:_files -/' 357 | '--security-path[Specify the shared security directory path]:security-path:_files -/' 358 | '--scratch-path[Specify a custom scratch directory path (default .build)]:scratch-path:_files -/' 359 | '--swift-sdks-path[Path to the directory containing installed Swift SDKs]:swift-sdks-path:_files -/' 360 | '--pkg-config-path[Specify alternative path to search for pkg-config `.pc` files. Use the option multiple times to 361 | specify more than one path.]:pkg-config-path:_files -/' 362 | '--enable-dependency-cache[Use a shared cache when fetching dependencies]' 363 | '--disable-dependency-cache[Use a shared cache when fetching dependencies]' 364 | '--enable-build-manifest-caching' 365 | '--disable-build-manifest-caching' 366 | '--manifest-cache[Caching mode of Package.swift manifests (shared: shared cache, local: package'"'"'s build directory, none: disabled]:manifest-cache:' 367 | '(--verbose -v)'{--verbose,-v}'[Increase verbosity to include informational output]' 368 | '(--very-verbose --vv)'{--very-verbose,--vv}'[Increase verbosity to include debug output]' 369 | '(--quiet -q)'{--quiet,-q}'[Decrease verbosity to only include error output.]' 370 | '--disable-sandbox[Disable using the sandbox when executing subprocesses]' 371 | '--netrc[Use netrc file even in cases where other credential stores are preferred]' 372 | '--enable-netrc[Load credentials from a netrc file]' 373 | '--disable-netrc[Load credentials from a netrc file]' 374 | '--netrc-file[Specify the netrc file path]:netrc-file:_files' 375 | '--enable-keychain[Search credentials in macOS keychain]' 376 | '--disable-keychain[Search credentials in macOS keychain]' 377 | '--resolver-fingerprint-checking:resolver-fingerprint-checking:' 378 | '--resolver-signing-entity-checking:resolver-signing-entity-checking:' 379 | '--enable-signature-validation[Validate signature of a signed package release downloaded from registry]' 380 | '--disable-signature-validation[Validate signature of a signed package release downloaded from registry]' 381 | '--enable-prefetching' 382 | '--disable-prefetching' 383 | '(--force-resolved-versions --disable-automatic-resolution --only-use-versions-from-resolved-file)'{--force-resolved-versions,--disable-automatic-resolution,--only-use-versions-from-resolved-file}'[Only use versions from the Package.resolved file and fail resolution if it is out-of-date]' 384 | '--skip-update[Skip updating dependencies from their remote during a resolution]' 385 | '--disable-scm-to-registry-transformation[disable source control to registry transformation]' 386 | '--use-registry-identity-for-scm[look up source control dependencies in the registry and use their registry identity when possible to help deduplicate across the two origins]' 387 | '--replace-scm-with-registry[look up source control dependencies in the registry and use the registry to retrieve them instead of source control when possible]' 388 | '--default-registry-url[Default registry URL to use, instead of the registries.json configuration file]:default-registry-url:' 389 | '(--configuration -c)'{--configuration,-c}'[Build with configuration]:configuration:(debug release)' 390 | '-Xcc[Pass flag through to all C compiler invocations]:Xcc:' 391 | '-Xswiftc[Pass flag through to all Swift compiler invocations]:Xswiftc:' 392 | '-Xlinker[Pass flag through to all linker invocations]:Xlinker:' 393 | '-Xcxx[Pass flag through to all C++ compiler invocations]:Xcxx:' 394 | '--triple:triple:' 395 | '--sdk:sdk:_files -/' 396 | '--toolchain:toolchain:_files -/' 397 | '--swift-sdk[Filter for selecting a specific Swift SDK to build with]:swift-sdk:' 398 | '--sanitize[Turn on runtime checks for erroneous behavior, possible values: address, thread, undefined, scudo]:sanitize:(address thread undefined scudo)' 399 | '--auto-index-store[Enable or disable indexing-while-building feature]' 400 | '--enable-index-store[Enable or disable indexing-while-building feature]' 401 | '--disable-index-store[Enable or disable indexing-while-building feature]' 402 | '--enable-parseable-module-interfaces' 403 | '(--jobs -j)'{--jobs,-j}'[The number of jobs to spawn in parallel during the build process]:jobs:' 404 | '--use-integrated-swift-driver' 405 | '--explicit-target-dependency-import-check:explicit-target-dependency-import-check:' 406 | '--experimental-explicit-module-build' 407 | '--build-system:build-system:(native xcode)' 408 | '-debug-info-format:debug-info-format:' 409 | '--enable-dead-strip[Disable/enable dead code stripping by the linker]' 410 | '--disable-dead-strip[Disable/enable dead code stripping by the linker]' 411 | '--disable-local-rpath[Disable adding $ORIGIN/@loader_path to the rpath by default]' 412 | '--version[Show the version.]' 413 | '(-help -h --help)'{-help,-h,--help}'[Show help information.]' 414 | '(-): :->command' 415 | '(-)*:: :->arg' 416 | ) 417 | _arguments -w -s -S $args[@] && ret=0 418 | case $state in 419 | (command) 420 | local subcommands 421 | subcommands=( 422 | 'add-dependency:Add a package dependency to the manifest' 423 | 'add-product:Add a new product to the manifest' 424 | 'add-target:Add a new target to the manifest' 425 | 'add-target-dependency:Add a new target dependency to the manifest' 426 | 'clean:Delete build artifacts' 427 | 'purge-cache:Purge the global repository cache.' 428 | 'reset:Reset the complete cache/build directory' 429 | 'update:Update package dependencies' 430 | 'describe:Describe the current package' 431 | 'init:Initialize a new package' 432 | 'experimental-install:Offers the ability to install executable products of the current package.' 433 | 'experimental-uninstall:Offers the ability to uninstall executable products previously installed by `swift package experimental-install`.' 434 | 'diagnose-api-breaking-changes:Diagnose API-breaking changes to Swift modules in a package' 435 | 'dump-symbol-graph:Dump Symbol Graph' 436 | 'dump-package:Print parsed Package.swift as JSON' 437 | 'edit:Put a package in editable mode' 438 | 'unedit:Remove a package from editable mode' 439 | 'config:Manipulate configuration of the package' 440 | 'resolve:Resolve package dependencies' 441 | 'show-dependencies:Print the resolved dependency graph' 442 | 'tools-version:Manipulate tools version of the current package' 443 | 'compute-checksum:Compute the checksum for a binary artifact.' 444 | 'archive-source:Create a source archive for the package' 445 | 'completion-tool:Completion command (for shell completions)' 446 | 'plugin:Invoke a command plugin or perform other actions on command plugins' 447 | ) 448 | _describe "subcommand" subcommands 449 | ;; 450 | (arg) 451 | case ${words[1]} in 452 | (add-dependency) 453 | _swift_package_add-dependency 454 | ;; 455 | (add-product) 456 | _swift_package_add-product 457 | ;; 458 | (add-target) 459 | _swift_package_add-target 460 | ;; 461 | (add-target-dependency) 462 | _swift_package_add-target-dependency 463 | ;; 464 | (clean) 465 | _swift_package_clean 466 | ;; 467 | (purge-cache) 468 | _swift_package_purge-cache 469 | ;; 470 | (reset) 471 | _swift_package_reset 472 | ;; 473 | (update) 474 | _swift_package_update 475 | ;; 476 | (describe) 477 | _swift_package_describe 478 | ;; 479 | (init) 480 | _swift_package_init 481 | ;; 482 | (experimental-install) 483 | _swift_package_experimental-install 484 | ;; 485 | (experimental-uninstall) 486 | _swift_package_experimental-uninstall 487 | ;; 488 | (diagnose-api-breaking-changes) 489 | _swift_package_diagnose-api-breaking-changes 490 | ;; 491 | (dump-symbol-graph) 492 | _swift_package_dump-symbol-graph 493 | ;; 494 | (dump-package) 495 | _swift_package_dump-package 496 | ;; 497 | (edit) 498 | _swift_package_edit 499 | ;; 500 | (unedit) 501 | _swift_package_unedit 502 | ;; 503 | (config) 504 | _swift_package_config 505 | ;; 506 | (resolve) 507 | _swift_package_resolve 508 | ;; 509 | (show-dependencies) 510 | _swift_package_show-dependencies 511 | ;; 512 | (tools-version) 513 | _swift_package_tools-version 514 | ;; 515 | (compute-checksum) 516 | _swift_package_compute-checksum 517 | ;; 518 | (archive-source) 519 | _swift_package_archive-source 520 | ;; 521 | (completion-tool) 522 | _swift_package_completion-tool 523 | ;; 524 | (plugin) 525 | _swift_package_plugin 526 | ;; 527 | esac 528 | ;; 529 | esac 530 | 531 | return ret 532 | } 533 | 534 | _swift_package_add-dependency() { 535 | integer ret=1 536 | local -a args 537 | args+=( 538 | ':dependency:' 539 | '--exact[The exact package version to depend on]:exact:' 540 | '--revision[The specific package revision to depend on]:revision:' 541 | '--branch[The branch of the package to depend on]:branch:' 542 | '--from[The package version to depend on (up to the next major version)]:from:' 543 | '--up-to-next-minor-from[The package version to depend on (up to the next minor version)]:up-to-next-minor-from:' 544 | '--to[Specify upper bound on the package version range (exclusive)]:to:' 545 | '--version[Show the version.]' 546 | '(-help -h --help)'{-help,-h,--help}'[Show help information.]' 547 | ) 548 | _arguments -w -s -S $args[@] && ret=0 549 | 550 | return ret 551 | } 552 | 553 | _swift_package_add-product() { 554 | integer ret=1 555 | local -a args 556 | args+=( 557 | ':name:' 558 | '--type[The type of target to add, which can be one of '"'"'executable'"'"', '"'"'library'"'"', '"'"'static-library'"'"', '"'"'dynamic-library'"'"', or '"'"'plugin'"'"']:type:' 559 | '--targets[A list of targets that are part of this product]:targets:' 560 | '--version[Show the version.]' 561 | '(-help -h --help)'{-help,-h,--help}'[Show help information.]' 562 | ) 563 | _arguments -w -s -S $args[@] && ret=0 564 | 565 | return ret 566 | } 567 | 568 | _swift_package_add-target() { 569 | integer ret=1 570 | local -a args 571 | args+=( 572 | ':name:' 573 | '--type[The type of target to add, which can be one of '"'"'library'"'"', '"'"'executable'"'"', '"'"'test'"'"', or '"'"'macro'"'"']:type:' 574 | '--dependencies[A list of target dependency names]:dependencies:' 575 | '--url[The URL for a remote binary target]:url:' 576 | '--path[The path to a local binary target]:path:' 577 | '--checksum[The checksum for a remote binary target]:checksum:' 578 | '--testing-library[The testing library to use when generating test targets, which can be one of '"'"'xctest'"'"', '"'"'swift-testing'"'"', or '"'"'none'"'"']:testing-library:' 579 | '--version[Show the version.]' 580 | '(-help -h --help)'{-help,-h,--help}'[Show help information.]' 581 | ) 582 | _arguments -w -s -S $args[@] && ret=0 583 | 584 | return ret 585 | } 586 | 587 | _swift_package_add-target-dependency() { 588 | integer ret=1 589 | local -a args 590 | args+=( 591 | ':dependency-name:' 592 | ':target-name:' 593 | '--package[The package in which the dependency resides]:package:' 594 | '--version[Show the version.]' 595 | '(-help -h --help)'{-help,-h,--help}'[Show help information.]' 596 | ) 597 | _arguments -w -s -S $args[@] && ret=0 598 | 599 | return ret 600 | } 601 | 602 | _swift_package_clean() { 603 | integer ret=1 604 | local -a args 605 | args+=( 606 | '--version[Show the version.]' 607 | '(-help -h --help)'{-help,-h,--help}'[Show help information.]' 608 | ) 609 | _arguments -w -s -S $args[@] && ret=0 610 | 611 | return ret 612 | } 613 | 614 | _swift_package_purge-cache() { 615 | integer ret=1 616 | local -a args 617 | args+=( 618 | '--version[Show the version.]' 619 | '(-help -h --help)'{-help,-h,--help}'[Show help information.]' 620 | ) 621 | _arguments -w -s -S $args[@] && ret=0 622 | 623 | return ret 624 | } 625 | 626 | _swift_package_reset() { 627 | integer ret=1 628 | local -a args 629 | args+=( 630 | '--version[Show the version.]' 631 | '(-help -h --help)'{-help,-h,--help}'[Show help information.]' 632 | ) 633 | _arguments -w -s -S $args[@] && ret=0 634 | 635 | return ret 636 | } 637 | 638 | _swift_package_update() { 639 | integer ret=1 640 | local -a args 641 | args+=( 642 | '(--dry-run -n)'{--dry-run,-n}'[Display the list of dependencies that can be updated]' 643 | ':packages:' 644 | '--version[Show the version.]' 645 | '(-help -h --help)'{-help,-h,--help}'[Show help information.]' 646 | ) 647 | _arguments -w -s -S $args[@] && ret=0 648 | 649 | return ret 650 | } 651 | 652 | _swift_package_describe() { 653 | integer ret=1 654 | local -a args 655 | args+=( 656 | '--type[json | text | mermaid]:type:' 657 | '--version[Show the version.]' 658 | '(-help -h --help)'{-help,-h,--help}'[Show help information.]' 659 | ) 660 | _arguments -w -s -S $args[@] && ret=0 661 | 662 | return ret 663 | } 664 | 665 | _swift_package_init() { 666 | integer ret=1 667 | local -a args 668 | args+=( 669 | '--type[Package type:]:type:' 670 | '--enable-xctest[Enable support for XCTest]' 671 | '--disable-xctest[Enable support for XCTest]' 672 | '--enable-swift-testing[Enable support for Swift Testing]' 673 | '--disable-swift-testing[Enable support for Swift Testing]' 674 | '--name[Provide custom package name]:name:' 675 | '--version[Show the version.]' 676 | '(-help -h --help)'{-help,-h,--help}'[Show help information.]' 677 | ) 678 | _arguments -w -s -S $args[@] && ret=0 679 | 680 | return ret 681 | } 682 | 683 | _swift_package_experimental-install() { 684 | integer ret=1 685 | local -a args 686 | args+=( 687 | '--package-path[Specify the package path to operate on (default current directory). This changes the working directory before any other operation]:package-path:_files -/' 688 | '--cache-path[Specify the shared cache directory path]:cache-path:_files -/' 689 | '--config-path[Specify the shared configuration directory path]:config-path:_files -/' 690 | '--security-path[Specify the shared security directory path]:security-path:_files -/' 691 | '--scratch-path[Specify a custom scratch directory path (default .build)]:scratch-path:_files -/' 692 | '--swift-sdks-path[Path to the directory containing installed Swift SDKs]:swift-sdks-path:_files -/' 693 | '--pkg-config-path[Specify alternative path to search for pkg-config `.pc` files. Use the option multiple times to 694 | specify more than one path.]:pkg-config-path:_files -/' 695 | '--enable-dependency-cache[Use a shared cache when fetching dependencies]' 696 | '--disable-dependency-cache[Use a shared cache when fetching dependencies]' 697 | '--enable-build-manifest-caching' 698 | '--disable-build-manifest-caching' 699 | '--manifest-cache[Caching mode of Package.swift manifests (shared: shared cache, local: package'"'"'s build directory, none: disabled]:manifest-cache:' 700 | '(--verbose -v)'{--verbose,-v}'[Increase verbosity to include informational output]' 701 | '(--very-verbose --vv)'{--very-verbose,--vv}'[Increase verbosity to include debug output]' 702 | '(--quiet -q)'{--quiet,-q}'[Decrease verbosity to only include error output.]' 703 | '--disable-sandbox[Disable using the sandbox when executing subprocesses]' 704 | '--netrc[Use netrc file even in cases where other credential stores are preferred]' 705 | '--enable-netrc[Load credentials from a netrc file]' 706 | '--disable-netrc[Load credentials from a netrc file]' 707 | '--netrc-file[Specify the netrc file path]:netrc-file:_files' 708 | '--enable-keychain[Search credentials in macOS keychain]' 709 | '--disable-keychain[Search credentials in macOS keychain]' 710 | '--resolver-fingerprint-checking:resolver-fingerprint-checking:' 711 | '--resolver-signing-entity-checking:resolver-signing-entity-checking:' 712 | '--enable-signature-validation[Validate signature of a signed package release downloaded from registry]' 713 | '--disable-signature-validation[Validate signature of a signed package release downloaded from registry]' 714 | '--enable-prefetching' 715 | '--disable-prefetching' 716 | '(--force-resolved-versions --disable-automatic-resolution --only-use-versions-from-resolved-file)'{--force-resolved-versions,--disable-automatic-resolution,--only-use-versions-from-resolved-file}'[Only use versions from the Package.resolved file and fail resolution if it is out-of-date]' 717 | '--skip-update[Skip updating dependencies from their remote during a resolution]' 718 | '--disable-scm-to-registry-transformation[disable source control to registry transformation]' 719 | '--use-registry-identity-for-scm[look up source control dependencies in the registry and use their registry identity when possible to help deduplicate across the two origins]' 720 | '--replace-scm-with-registry[look up source control dependencies in the registry and use the registry to retrieve them instead of source control when possible]' 721 | '--default-registry-url[Default registry URL to use, instead of the registries.json configuration file]:default-registry-url:' 722 | '(--configuration -c)'{--configuration,-c}'[Build with configuration]:configuration:(debug release)' 723 | '-Xcc[Pass flag through to all C compiler invocations]:Xcc:' 724 | '-Xswiftc[Pass flag through to all Swift compiler invocations]:Xswiftc:' 725 | '-Xlinker[Pass flag through to all linker invocations]:Xlinker:' 726 | '-Xcxx[Pass flag through to all C++ compiler invocations]:Xcxx:' 727 | '--triple:triple:' 728 | '--sdk:sdk:_files -/' 729 | '--toolchain:toolchain:_files -/' 730 | '--swift-sdk[Filter for selecting a specific Swift SDK to build with]:swift-sdk:' 731 | '--sanitize[Turn on runtime checks for erroneous behavior, possible values: address, thread, undefined, scudo]:sanitize:(address thread undefined scudo)' 732 | '--auto-index-store[Enable or disable indexing-while-building feature]' 733 | '--enable-index-store[Enable or disable indexing-while-building feature]' 734 | '--disable-index-store[Enable or disable indexing-while-building feature]' 735 | '--enable-parseable-module-interfaces' 736 | '(--jobs -j)'{--jobs,-j}'[The number of jobs to spawn in parallel during the build process]:jobs:' 737 | '--use-integrated-swift-driver' 738 | '--explicit-target-dependency-import-check:explicit-target-dependency-import-check:' 739 | '--experimental-explicit-module-build' 740 | '--build-system:build-system:(native xcode)' 741 | '-debug-info-format:debug-info-format:' 742 | '--enable-dead-strip[Disable/enable dead code stripping by the linker]' 743 | '--disable-dead-strip[Disable/enable dead code stripping by the linker]' 744 | '--disable-local-rpath[Disable adding $ORIGIN/@loader_path to the rpath by default]' 745 | '--product[The name of the executable product to install]:product:' 746 | '--version[Show the version.]' 747 | '(-help -h --help)'{-help,-h,--help}'[Show help information.]' 748 | ) 749 | _arguments -w -s -S $args[@] && ret=0 750 | 751 | return ret 752 | } 753 | 754 | _swift_package_experimental-uninstall() { 755 | integer ret=1 756 | local -a args 757 | args+=( 758 | '--package-path[Specify the package path to operate on (default current directory). This changes the working directory before any other operation]:package-path:_files -/' 759 | '--cache-path[Specify the shared cache directory path]:cache-path:_files -/' 760 | '--config-path[Specify the shared configuration directory path]:config-path:_files -/' 761 | '--security-path[Specify the shared security directory path]:security-path:_files -/' 762 | '--scratch-path[Specify a custom scratch directory path (default .build)]:scratch-path:_files -/' 763 | '--swift-sdks-path[Path to the directory containing installed Swift SDKs]:swift-sdks-path:_files -/' 764 | '--pkg-config-path[Specify alternative path to search for pkg-config `.pc` files. Use the option multiple times to 765 | specify more than one path.]:pkg-config-path:_files -/' 766 | '--enable-dependency-cache[Use a shared cache when fetching dependencies]' 767 | '--disable-dependency-cache[Use a shared cache when fetching dependencies]' 768 | '--enable-build-manifest-caching' 769 | '--disable-build-manifest-caching' 770 | '--manifest-cache[Caching mode of Package.swift manifests (shared: shared cache, local: package'"'"'s build directory, none: disabled]:manifest-cache:' 771 | '(--verbose -v)'{--verbose,-v}'[Increase verbosity to include informational output]' 772 | '(--very-verbose --vv)'{--very-verbose,--vv}'[Increase verbosity to include debug output]' 773 | '(--quiet -q)'{--quiet,-q}'[Decrease verbosity to only include error output.]' 774 | '--disable-sandbox[Disable using the sandbox when executing subprocesses]' 775 | '--netrc[Use netrc file even in cases where other credential stores are preferred]' 776 | '--enable-netrc[Load credentials from a netrc file]' 777 | '--disable-netrc[Load credentials from a netrc file]' 778 | '--netrc-file[Specify the netrc file path]:netrc-file:_files' 779 | '--enable-keychain[Search credentials in macOS keychain]' 780 | '--disable-keychain[Search credentials in macOS keychain]' 781 | '--resolver-fingerprint-checking:resolver-fingerprint-checking:' 782 | '--resolver-signing-entity-checking:resolver-signing-entity-checking:' 783 | '--enable-signature-validation[Validate signature of a signed package release downloaded from registry]' 784 | '--disable-signature-validation[Validate signature of a signed package release downloaded from registry]' 785 | '--enable-prefetching' 786 | '--disable-prefetching' 787 | '(--force-resolved-versions --disable-automatic-resolution --only-use-versions-from-resolved-file)'{--force-resolved-versions,--disable-automatic-resolution,--only-use-versions-from-resolved-file}'[Only use versions from the Package.resolved file and fail resolution if it is out-of-date]' 788 | '--skip-update[Skip updating dependencies from their remote during a resolution]' 789 | '--disable-scm-to-registry-transformation[disable source control to registry transformation]' 790 | '--use-registry-identity-for-scm[look up source control dependencies in the registry and use their registry identity when possible to help deduplicate across the two origins]' 791 | '--replace-scm-with-registry[look up source control dependencies in the registry and use the registry to retrieve them instead of source control when possible]' 792 | '--default-registry-url[Default registry URL to use, instead of the registries.json configuration file]:default-registry-url:' 793 | '(--configuration -c)'{--configuration,-c}'[Build with configuration]:configuration:(debug release)' 794 | '-Xcc[Pass flag through to all C compiler invocations]:Xcc:' 795 | '-Xswiftc[Pass flag through to all Swift compiler invocations]:Xswiftc:' 796 | '-Xlinker[Pass flag through to all linker invocations]:Xlinker:' 797 | '-Xcxx[Pass flag through to all C++ compiler invocations]:Xcxx:' 798 | '--triple:triple:' 799 | '--sdk:sdk:_files -/' 800 | '--toolchain:toolchain:_files -/' 801 | '--swift-sdk[Filter for selecting a specific Swift SDK to build with]:swift-sdk:' 802 | '--sanitize[Turn on runtime checks for erroneous behavior, possible values: address, thread, undefined, scudo]:sanitize:(address thread undefined scudo)' 803 | '--auto-index-store[Enable or disable indexing-while-building feature]' 804 | '--enable-index-store[Enable or disable indexing-while-building feature]' 805 | '--disable-index-store[Enable or disable indexing-while-building feature]' 806 | '--enable-parseable-module-interfaces' 807 | '(--jobs -j)'{--jobs,-j}'[The number of jobs to spawn in parallel during the build process]:jobs:' 808 | '--use-integrated-swift-driver' 809 | '--explicit-target-dependency-import-check:explicit-target-dependency-import-check:' 810 | '--experimental-explicit-module-build' 811 | '--build-system:build-system:(native xcode)' 812 | '-debug-info-format:debug-info-format:' 813 | '--enable-dead-strip[Disable/enable dead code stripping by the linker]' 814 | '--disable-dead-strip[Disable/enable dead code stripping by the linker]' 815 | '--disable-local-rpath[Disable adding $ORIGIN/@loader_path to the rpath by default]' 816 | ':name:' 817 | '--version[Show the version.]' 818 | '(-help -h --help)'{-help,-h,--help}'[Show help information.]' 819 | ) 820 | _arguments -w -s -S $args[@] && ret=0 821 | 822 | return ret 823 | } 824 | 825 | _swift_package_diagnose-api-breaking-changes() { 826 | integer ret=1 827 | local -a args 828 | args+=( 829 | '--breakage-allowlist-path[The path to a text file containing breaking changes which should be ignored by the API comparison. Each ignored breaking change in the file should appear on its own line and contain the exact message to be ignored (e.g. '"'"'API breakage: func foo() has been removed'"'"').]:breakage-allowlist-path:_files -/' 830 | ':treeish:' 831 | '--products[One or more products to include in the API comparison. If present, only the specified products (and any targets specified using `--targets`) will be compared.]:products:' 832 | '--targets[One or more targets to include in the API comparison. If present, only the specified targets (and any products specified using `--products`) will be compared.]:targets:' 833 | '--baseline-dir[The path to a directory used to store API baseline files. If unspecified, a temporary directory will be used.]:baseline-dir:_files -/' 834 | '--regenerate-baseline[Regenerate the API baseline, even if an existing one is available.]' 835 | '--version[Show the version.]' 836 | '(-help -h --help)'{-help,-h,--help}'[Show help information.]' 837 | ) 838 | _arguments -w -s -S $args[@] && ret=0 839 | 840 | return ret 841 | } 842 | 843 | _swift_package_dump-symbol-graph() { 844 | integer ret=1 845 | local -a args 846 | args+=( 847 | '--pretty-print[Pretty-print the output JSON.]' 848 | '--skip-synthesized-members[Skip members inherited through classes or default implementations.]' 849 | '--minimum-access-level[Include symbols with this access level or more. Possible values: private | fileprivate | internal | public | open]:minimum-access-level:(private fileprivate internal public open)' 850 | '--skip-inherited-docs[Skip emitting doc comments for members inherited through classes or default implementations.]' 851 | '--include-spi-symbols[Add symbols with SPI information to the symbol graph.]' 852 | '--emit-extension-block-symbols[Emit extension block symbols for extensions to external types or directly associate members and conformances with the extended nominal.]' 853 | '--omit-extension-block-symbols[Emit extension block symbols for extensions to external types or directly associate members and conformances with the extended nominal.]' 854 | '--version[Show the version.]' 855 | '(-help -h --help)'{-help,-h,--help}'[Show help information.]' 856 | ) 857 | _arguments -w -s -S $args[@] && ret=0 858 | 859 | return ret 860 | } 861 | 862 | _swift_package_dump-package() { 863 | integer ret=1 864 | local -a args 865 | args+=( 866 | '--version[Show the version.]' 867 | '(-help -h --help)'{-help,-h,--help}'[Show help information.]' 868 | ) 869 | _arguments -w -s -S $args[@] && ret=0 870 | 871 | return ret 872 | } 873 | 874 | _swift_package_edit() { 875 | integer ret=1 876 | local -a args 877 | args+=( 878 | '--revision[The revision to edit]:revision:' 879 | '--branch[The branch to create]:branch:' 880 | '--path[Create or use the checkout at this path]:path:_files -/' 881 | ':package-name:' 882 | '--version[Show the version.]' 883 | '(-help -h --help)'{-help,-h,--help}'[Show help information.]' 884 | ) 885 | _arguments -w -s -S $args[@] && ret=0 886 | 887 | return ret 888 | } 889 | 890 | _swift_package_unedit() { 891 | integer ret=1 892 | local -a args 893 | args+=( 894 | '--force[Unedit the package even if it has uncommitted and unpushed changes]' 895 | ':package-name:' 896 | '--version[Show the version.]' 897 | '(-help -h --help)'{-help,-h,--help}'[Show help information.]' 898 | ) 899 | _arguments -w -s -S $args[@] && ret=0 900 | 901 | return ret 902 | } 903 | 904 | _swift_package_config() { 905 | integer ret=1 906 | local -a args 907 | args+=( 908 | '--version[Show the version.]' 909 | '(-help -h --help)'{-help,-h,--help}'[Show help information.]' 910 | '(-): :->command' 911 | '(-)*:: :->arg' 912 | ) 913 | _arguments -w -s -S $args[@] && ret=0 914 | case $state in 915 | (command) 916 | local subcommands 917 | subcommands=( 918 | 'set-mirror:Set a mirror for a dependency' 919 | 'unset-mirror:Remove an existing mirror' 920 | 'get-mirror:Print mirror configuration for the given package dependency' 921 | ) 922 | _describe "subcommand" subcommands 923 | ;; 924 | (arg) 925 | case ${words[1]} in 926 | (set-mirror) 927 | _swift_package_config_set-mirror 928 | ;; 929 | (unset-mirror) 930 | _swift_package_config_unset-mirror 931 | ;; 932 | (get-mirror) 933 | _swift_package_config_get-mirror 934 | ;; 935 | esac 936 | ;; 937 | esac 938 | 939 | return ret 940 | } 941 | 942 | _swift_package_config_set-mirror() { 943 | integer ret=1 944 | local -a args 945 | args+=( 946 | '--original[The original url or identity]:original:' 947 | '--mirror[The mirror url or identity]:mirror:' 948 | '--version[Show the version.]' 949 | '(-help -h --help)'{-help,-h,--help}'[Show help information.]' 950 | ) 951 | _arguments -w -s -S $args[@] && ret=0 952 | 953 | return ret 954 | } 955 | 956 | _swift_package_config_unset-mirror() { 957 | integer ret=1 958 | local -a args 959 | args+=( 960 | '--original[The original url or identity]:original:' 961 | '--mirror[The mirror url or identity]:mirror:' 962 | '--version[Show the version.]' 963 | '(-help -h --help)'{-help,-h,--help}'[Show help information.]' 964 | ) 965 | _arguments -w -s -S $args[@] && ret=0 966 | 967 | return ret 968 | } 969 | 970 | _swift_package_config_get-mirror() { 971 | integer ret=1 972 | local -a args 973 | args+=( 974 | '--original[The original url or identity]:original:' 975 | '--version[Show the version.]' 976 | '(-help -h --help)'{-help,-h,--help}'[Show help information.]' 977 | ) 978 | _arguments -w -s -S $args[@] && ret=0 979 | 980 | return ret 981 | } 982 | 983 | _swift_package_resolve() { 984 | integer ret=1 985 | local -a args 986 | args+=( 987 | '--version[The version to resolve at]:version:' 988 | '--branch[The branch to resolve at]:branch:' 989 | '--revision[The revision to resolve at]:revision:' 990 | ':package-name:' 991 | '--version[Show the version.]' 992 | '(-help -h --help)'{-help,-h,--help}'[Show help information.]' 993 | ) 994 | _arguments -w -s -S $args[@] && ret=0 995 | 996 | return ret 997 | } 998 | 999 | _swift_package_show-dependencies() { 1000 | integer ret=1 1001 | local -a args 1002 | args+=( 1003 | '--format[text | dot | json | flatlist]:format:' 1004 | '(--output-path -o)'{--output-path,-o}'[The absolute or relative path to output the resolved dependency graph.]:output-path:_files -/' 1005 | '--version[Show the version.]' 1006 | '(-help -h --help)'{-help,-h,--help}'[Show help information.]' 1007 | ) 1008 | _arguments -w -s -S $args[@] && ret=0 1009 | 1010 | return ret 1011 | } 1012 | 1013 | _swift_package_tools-version() { 1014 | integer ret=1 1015 | local -a args 1016 | args+=( 1017 | '--set-current[Set tools version of package to the current tools version in use]' 1018 | '--set[Set tools version of package to the given value]:set:' 1019 | '--version[Show the version.]' 1020 | '(-help -h --help)'{-help,-h,--help}'[Show help information.]' 1021 | ) 1022 | _arguments -w -s -S $args[@] && ret=0 1023 | 1024 | return ret 1025 | } 1026 | 1027 | _swift_package_compute-checksum() { 1028 | integer ret=1 1029 | local -a args 1030 | args+=( 1031 | ':path:_files -/' 1032 | '--version[Show the version.]' 1033 | '(-help -h --help)'{-help,-h,--help}'[Show help information.]' 1034 | ) 1035 | _arguments -w -s -S $args[@] && ret=0 1036 | 1037 | return ret 1038 | } 1039 | 1040 | _swift_package_archive-source() { 1041 | integer ret=1 1042 | local -a args 1043 | args+=( 1044 | '(-o --output)'{-o,--output}'[The absolute or relative path for the generated source archive]:output:_files -/' 1045 | '--version[Show the version.]' 1046 | '(-help -h --help)'{-help,-h,--help}'[Show help information.]' 1047 | ) 1048 | _arguments -w -s -S $args[@] && ret=0 1049 | 1050 | return ret 1051 | } 1052 | 1053 | _swift_package_completion-tool() { 1054 | integer ret=1 1055 | local -a args 1056 | args+=( 1057 | ':mode:(generate-bash-script generate-zsh-script generate-fish-script list-dependencies list-executables list-snippets)' 1058 | '--version[Show the version.]' 1059 | '(-help -h --help)'{-help,-h,--help}'[Show help information.]' 1060 | ) 1061 | _arguments -w -s -S $args[@] && ret=0 1062 | 1063 | return ret 1064 | } 1065 | 1066 | _swift_package_plugin() { 1067 | integer ret=1 1068 | local -a args 1069 | args+=( 1070 | '--list[List the available command plugins]' 1071 | '--allow-writing-to-package-directory[Allow the plugin to write to the package directory]' 1072 | '--allow-writing-to-directory[Allow the plugin to write to an additional directory]:allow-writing-to-directory:' 1073 | '--allow-network-connections:allow-network-connections:(none local(ports: []) all(ports: []) docker unixDomainSocket)' 1074 | '--package[Limit available plugins to a single package with the given identity]:package:' 1075 | ':command:' 1076 | ':arguments:' 1077 | '--version[Show the version.]' 1078 | '(-help -h --help)'{-help,-h,--help}'[Show help information.]' 1079 | ) 1080 | _arguments -w -s -S $args[@] && ret=0 1081 | 1082 | return ret 1083 | } 1084 | 1085 | _swift_help() { 1086 | integer ret=1 1087 | local -a args 1088 | args+=( 1089 | ':subcommands:' 1090 | ) 1091 | _arguments -w -s -S $args[@] && ret=0 1092 | 1093 | return ret 1094 | } 1095 | 1096 | 1097 | _custom_completion() { 1098 | local completions=("${(@f)$($*)}") 1099 | _describe '' completions 1100 | } 1101 | 1102 | _swift 1103 | -------------------------------------------------------------------------------- /completions/_xcrun: -------------------------------------------------------------------------------- 1 | #compdef xcrun 2 | 3 | _xcrun() { 4 | _arguments \ 5 | "(-h --help)"{-h,--help}"[show this help message and exit]" \ 6 | "--version[show the xcrun version]" \ 7 | "(-v --verbose)"{-v,--verbose}"[show verbose logging output]" \ 8 | "--sdk[find the tool for the given SDK name]:sdk" \ 9 | "--toolchain[find the tool for the given toolchain]:toolchain" \ 10 | "(-l --log)"{-l,--log}"[show commands to be executed (with --run)]" \ 11 | "(-f --find)"{-f,--find}"[only find and print the tool path]" \ 12 | "(-r --run)"{-r,--run}"[find and execute the tool (the default behavior)]" \ 13 | "(-n --no-cache)"{-n,--no-cache}"[do not use the lookup cache]" \ 14 | "(-k --kill-cache)"{-k,--kill-cache}"[invalidate all existing cache entries]" \ 15 | "--show-sdk-path[show selected SDK install path]" \ 16 | "--show-sdk-version[show selected SDK version]" \ 17 | "--show-sdk-build-version[show selected SDK build version]" \ 18 | "--show-sdk-platform-path[show selected SDK platform path]" \ 19 | "--show-sdk-platform-version[show selected SDK platform version]" 20 | } -------------------------------------------------------------------------------- /completions/_xed: -------------------------------------------------------------------------------- 1 | #compdef xed 2 | 3 | _xed() { 4 | _arguments -s \ 5 | - help \ 6 | "(-h --help)"{-h,--help}"[Show help.]" \ 7 | - version \ 8 | "(-v --version)"{-v,--version}"[Print version information.]" \ 9 | - others \ 10 | "(-x --launch)"{-x,--launch}"[Just launch Xcode with a new untitled document, don't wait on stdin.]" \ 11 | "(-c --create)"{-c,--create}"[Create the files if they do not exist.]" \ 12 | "(-w --wait)"{-w,--wait}"[Wait for file to be closed by Xcode.]" \ 13 | "(-b --background)"{-b,--background}"[Leave Xcode as a background app after opening.]" \ 14 | "(-l --line)"{-l,--line}"[Select line after opening file.]:line number" \ 15 | "*::filename:_files" 16 | } 17 | -------------------------------------------------------------------------------- /mac-zsh-completions.plugin.zsh: -------------------------------------------------------------------------------- 1 | #!/bin/zsh 2 | fpath+="${0:h}/completions" -------------------------------------------------------------------------------- /todo.md: -------------------------------------------------------------------------------- 1 | - [x] desktoppr 2 | - [ ] xattr 3 | - [ ] dscl 4 | - [ ] dseditgroup 5 | - [ ] dsenableroot 6 | - [ ] launchctl 7 | - [x] jamf 8 | - [ ] pkgbuild 9 | - [ ] productbuild 10 | - [x] swift 11 | - [x] xed 12 | - [ ] xcodebuild 13 | - [ ] xcrun (started) 14 | - [x] bbedit 15 | - [ ] bbdiff 16 | - [ ] bbresults 17 | - [ ] bbfind 18 | - [ ] shellcheck 19 | - [ ] dsenableroot 20 | - [ ] sysctl 21 | - [ ] ioreg 22 | - [ ] profiles 23 | - [x] plutil 24 | - [x] PlistBuddy 25 | - [x] installer 26 | - [ ] diskutil 27 | - [ ] dsimport 28 | - [ ] log 29 | - [ ] sysadminctl 30 | - [ ] autopkg 31 | - [ ] startosinstall 32 | - [ ] createinstallmedia 33 | - [ ] tccutil 34 | - [ ] tmutil 35 | - [ ] quickpkg 36 | - [ ] diskutil 37 | - [ ] fdesetup 38 | - [x] see 39 | - [ ] app-sso 40 | 41 | 42 | 43 | 44 | *zsh 5.3 (High Sierra/Mojave)* 45 | 46 | - defaults 47 | - fink 48 | - hdiutil 49 | - open 50 | - softwareupdate 51 | - system_profiler 52 | 53 | *zsh 5.7.1 (Catalina)* 54 | 55 | - caffeinate 56 | - defaults 57 | - fink 58 | - fs_usage 59 | - hdiutil 60 | - mdfind 61 | - mdls 62 | - mdutil 63 | - networksetup 64 | - nvram 65 | - open 66 | - osascript 67 | - otool 68 | - pbcopy/pbpaste 69 | - plutil 70 | - say 71 | - sc_usage 72 | - scselect 73 | - scutil 74 | - softwareupdate (enhanced for Catalina) 75 | - sw_vers 76 | - swift 77 | - system_profiler 78 | - xcode_select 79 | --------------------------------------------------------------------------------