2 local context state state_descr line
7 '(- :)--help[prints the synopsis and a list of the most commonly used commands]: :->arg' \
9 '(-)*:: :->arg' && return
15 'build:build sources into binary products'
16 'run:build and run an executable product'
17 'package:perform operations on Swift packages'
18 'test:build and run tests'
21 'tools:common:{_describe "tool" tools }' \
22 'compiler: :_swift_compiler' && _ret=0
48 dependencies=( $(swift package completion-tool list-dependencies) )
49 _describe '' dependencies
54 executables=( $(swift package completion-tool list-executables) )
55 _describe '' executables
58 # Generates completions for swift build
60 # In the final compdef file, set the following file header:
62 # #compdef _swift_build
63 # local context state state_descr line
67 "-Xcc[Pass flag through to all C compiler invocations]:Pass flag through to all C compiler invocations: "
68 "-Xswiftc[Pass flag through to all Swift compiler invocations]:Pass flag through to all Swift compiler invocations: "
69 "-Xlinker[Pass flag through to all linker invocations]:Pass flag through to all linker invocations: "
70 "-Xcxx[Pass flag through to all C++ compiler invocations]:Pass flag through to all C++ compiler invocations: "
71 "(--configuration -c)"{--configuration,-c}"[Build with configuration (debug|release) ]: :{_values '' 'debug[build with DEBUG configuration]' 'release[build with RELEASE configuration]'}"
72 "--build-path[Specify build/cache directory ]:Specify build/cache directory :_files"
73 "(--chdir -C)"{--chdir,-C}"[]: :_files"
74 "--package-path[Change working directory before any other operation]:Change working directory before any other operation:_files"
75 "--sanitize[Turn on runtime checks for erroneous behavior]: :{_values '' 'address[enable Address sanitizer]' 'thread[enable Thread sanitizer]' 'undefined[enable Undefined Behavior sanitizer]'}"
76 "--disable-prefetching[]"
77 "--skip-update[Skip updating dependencies from their remote during a resolution]"
78 "--disable-sandbox[Disable using the sandbox when executing subprocesses]"
79 "--disable-package-manifest-caching[Disable caching Package.swift manifests]"
81 "--destination[]: :_files"
82 "(--verbose -v)"{--verbose,-v}"[Increase verbosity of informational output]"
83 "--no-static-swift-stdlib[Do not link Swift stdlib statically \[default\]]"
84 "--static-swift-stdlib[Link Swift stdlib statically]"
85 "--force-resolved-versions[]"
86 "--disable-automatic-resolution[Disable automatic resolution if Package.resolved file is out-of-date]"
87 "--enable-index-store[Enable indexing-while-building feature]"
88 "--disable-index-store[Disable indexing-while-building feature]"
89 "--enable-pubgrub-resolver[\[Experimental\] Enable the new Pubgrub dependency resolver]"
90 "--enable-parseable-module-interfaces[]"
92 "(--jobs -j)"{--jobs,-j}"[The number of jobs to spawn in parallel during the build process]:The number of jobs to spawn in parallel during the build process: "
93 "--enable-test-discovery[Enable test discovery on platforms without Objective-C runtime]"
94 "--build-tests[Build both source and test targets]"
95 "--product[Build the specified product]:Build the specified product: "
96 "--target[Build the specified target]:Build the specified target: "
97 "--show-bin-path[Print the binary output path]"
99 _arguments $arguments && return
102 # Generates completions for swift run
104 # In the final compdef file, set the following file header:
106 # #compdef _swift_run
107 # local context state state_descr line
108 # typeset -A opt_args
111 ":The executable to run:_swift_executable"
112 "-Xcc[Pass flag through to all C compiler invocations]:Pass flag through to all C compiler invocations: "
113 "-Xswiftc[Pass flag through to all Swift compiler invocations]:Pass flag through to all Swift compiler invocations: "
114 "-Xlinker[Pass flag through to all linker invocations]:Pass flag through to all linker invocations: "
115 "-Xcxx[Pass flag through to all C++ compiler invocations]:Pass flag through to all C++ compiler invocations: "
116 "(--configuration -c)"{--configuration,-c}"[Build with configuration (debug|release) ]: :{_values '' 'debug[build with DEBUG configuration]' 'release[build with RELEASE configuration]'}"
117 "--build-path[Specify build/cache directory ]:Specify build/cache directory :_files"
118 "(--chdir -C)"{--chdir,-C}"[]: :_files"
119 "--package-path[Change working directory before any other operation]:Change working directory before any other operation:_files"
120 "--sanitize[Turn on runtime checks for erroneous behavior]: :{_values '' 'address[enable Address sanitizer]' 'thread[enable Thread sanitizer]' 'undefined[enable Undefined Behavior sanitizer]'}"
121 "--disable-prefetching[]"
122 "--skip-update[Skip updating dependencies from their remote during a resolution]"
123 "--disable-sandbox[Disable using the sandbox when executing subprocesses]"
124 "--disable-package-manifest-caching[Disable caching Package.swift manifests]"
126 "--destination[]: :_files"
127 "(--verbose -v)"{--verbose,-v}"[Increase verbosity of informational output]"
128 "--no-static-swift-stdlib[Do not link Swift stdlib statically \[default\]]"
129 "--static-swift-stdlib[Link Swift stdlib statically]"
130 "--force-resolved-versions[]"
131 "--disable-automatic-resolution[Disable automatic resolution if Package.resolved file is out-of-date]"
132 "--enable-index-store[Enable indexing-while-building feature]"
133 "--disable-index-store[Disable indexing-while-building feature]"
134 "--enable-pubgrub-resolver[\[Experimental\] Enable the new Pubgrub dependency resolver]"
135 "--enable-parseable-module-interfaces[]"
137 "(--jobs -j)"{--jobs,-j}"[The number of jobs to spawn in parallel during the build process]:The number of jobs to spawn in parallel during the build process: "
138 "--enable-test-discovery[Enable test discovery on platforms without Objective-C runtime]"
139 "--skip-build[Skip building the executable product]"
140 "--build-tests[Build both source and test targets]"
141 "--repl[Launch Swift REPL for the package]"
143 _arguments $arguments && return
146 # Generates completions for swift package
148 # In the final compdef file, set the following file header:
150 # #compdef _swift_package
151 # local context state state_descr line
152 # typeset -A opt_args
155 "-Xcc[Pass flag through to all C compiler invocations]:Pass flag through to all C compiler invocations: "
156 "-Xswiftc[Pass flag through to all Swift compiler invocations]:Pass flag through to all Swift compiler invocations: "
157 "-Xlinker[Pass flag through to all linker invocations]:Pass flag through to all linker invocations: "
158 "-Xcxx[Pass flag through to all C++ compiler invocations]:Pass flag through to all C++ compiler invocations: "
159 "(--configuration -c)"{--configuration,-c}"[Build with configuration (debug|release) ]: :{_values '' 'debug[build with DEBUG configuration]' 'release[build with RELEASE configuration]'}"
160 "--build-path[Specify build/cache directory ]:Specify build/cache directory :_files"
161 "(--chdir -C)"{--chdir,-C}"[]: :_files"
162 "--package-path[Change working directory before any other operation]:Change working directory before any other operation:_files"
163 "--sanitize[Turn on runtime checks for erroneous behavior]: :{_values '' 'address[enable Address sanitizer]' 'thread[enable Thread sanitizer]' 'undefined[enable Undefined Behavior sanitizer]'}"
164 "--disable-prefetching[]"
165 "--skip-update[Skip updating dependencies from their remote during a resolution]"
166 "--disable-sandbox[Disable using the sandbox when executing subprocesses]"
167 "--disable-package-manifest-caching[Disable caching Package.swift manifests]"
169 "--destination[]: :_files"
170 "(--verbose -v)"{--verbose,-v}"[Increase verbosity of informational output]"
171 "--no-static-swift-stdlib[Do not link Swift stdlib statically \[default\]]"
172 "--static-swift-stdlib[Link Swift stdlib statically]"
173 "--force-resolved-versions[]"
174 "--disable-automatic-resolution[Disable automatic resolution if Package.resolved file is out-of-date]"
175 "--enable-index-store[Enable indexing-while-building feature]"
176 "--disable-index-store[Disable indexing-while-building feature]"
177 "--enable-pubgrub-resolver[\[Experimental\] Enable the new Pubgrub dependency resolver]"
178 "--enable-parseable-module-interfaces[]"
180 "(--jobs -j)"{--jobs,-j}"[The number of jobs to spawn in parallel during the build process]:The number of jobs to spawn in parallel during the build process: "
181 "--enable-test-discovery[Enable test discovery on platforms without Objective-C runtime]"
185 _arguments $arguments && return
190 'completion-tool:Completion tool (for shell completions)'
191 'dump-package:Print parsed Package.swift as JSON'
192 'describe:Describe the current package'
193 'clean:Delete build artifacts'
194 'show-dependencies:Print the resolved dependency graph'
195 'init:Initialize a new package'
196 'unedit:Remove a package from editable mode'
197 'tools-version:Manipulate tools version of the current package'
199 'resolve:Resolve package dependencies'
200 'reset:Reset the complete cache/build directory'
201 'generate-xcodeproj:Generates an Xcode project'
202 'edit:Put a package in editable mode'
203 'config:Manipulate configuration of the package'
204 'update:Update package dependencies'
206 _describe "mode" modes
211 _swift_package_completion-tool
214 _swift_package_dump-package
217 _swift_package_describe
223 _swift_package_show-dependencies
229 _swift_package_unedit
232 _swift_package_tools-version
238 _swift_package_resolve
244 _swift_package_generate-xcodeproj
250 _swift_package_config
253 _swift_package_update
260 _swift_package_completion-tool() {
262 ": :{_values '' 'generate-bash-script[generate Bash completion script]' 'generate-zsh-script[generate Bash completion script]' 'list-dependencies[list all dependencies' names]' 'list-executables[list all executables' names]'}"
264 _arguments $arguments && return
267 _swift_package_dump-package() {
270 _arguments $arguments && return
273 _swift_package_describe() {
275 "--type[json|text]: :{_values '' 'text[describe using text format]' 'json[describe using JSON format]'}"
277 _arguments $arguments && return
280 _swift_package_clean() {
283 _arguments $arguments && return
286 _swift_package_show-dependencies() {
288 "--format[text|dot|json|flatlist]: :{_values '' 'text[list dependencies using text format]' 'dot[list dependencies using dot format]' 'json[list dependencies using JSON format]'}"
290 _arguments $arguments && return
293 _swift_package_init() {
295 "--type[empty|library|executable|system-module|manifest]: :{_values '' 'empty[generates an empty project]' 'library[generates project for a dynamic library]' 'executable[generates a project for a cli executable]' 'system-module[generates a project for a system module]'}"
296 "--name[Provide custom package name]:Provide custom package name: "
298 _arguments $arguments && return
301 _swift_package_unedit() {
303 ":The name of the package to unedit:_swift_dependency"
304 "--force[Unedit the package even if it has uncommitted and unpushed changes.]"
306 _arguments $arguments && return
309 _swift_package_tools-version() {
311 "--set[Set tools version of package to the given value]:Set tools version of package to the given value: "
312 "--set-current[Set tools version of package to the current tools version in use]"
314 _arguments $arguments && return
317 _swift_package_fetch() {
320 _arguments $arguments && return
323 _swift_package_resolve() {
325 ":The name of the package to resolve:_swift_dependency"
326 "--version[The version to resolve at]:The version to resolve at: "
327 "--branch[The branch to resolve at]:The branch to resolve at: "
328 "--revision[The revision to resolve at]:The revision to resolve at: "
330 _arguments $arguments && return
333 _swift_package_reset() {
336 _arguments $arguments && return
339 _swift_package_generate-xcodeproj() {
341 "--xcconfig-overrides[Path to xcconfig file]:Path to xcconfig file:_files"
342 "--enable-code-coverage[Enable code coverage in the generated project]"
343 "--output[Path where the Xcode project should be generated]:Path where the Xcode project should be generated:_files"
344 "--legacy-scheme-generator[Use the legacy scheme generator]"
345 "--watch[Watch for changes to the Package manifest to regenerate the Xcode project]"
346 "--skip-extra-files[Do not add file references for extra files to the generated Xcode project]"
348 _arguments $arguments && return
351 _swift_package_edit() {
353 ":The name of the package to edit:_swift_dependency"
354 "--revision[The revision to edit]:The revision to edit: "
355 "--branch[The branch to create]:The branch to create: "
356 "--path[Create or use the checkout at this path]:Create or use the checkout at this path:_files"
358 _arguments $arguments && return
361 _swift_package_config() {
366 _arguments $arguments && return
371 'unset-mirror:Remove an existing mirror'
372 'get-mirror:Print mirror configuration for the given package dependency'
373 'set-mirror:Set a mirror for a dependency'
375 _describe "mode" modes
380 _swift_package_config_unset-mirror
383 _swift_package_config_get-mirror
386 _swift_package_config_set-mirror
393 _swift_package_config_unset-mirror() {
395 "--package-url[The package dependency url]:The package dependency url: "
396 "--mirror-url[The mirror url]:The mirror url: "
398 _arguments $arguments && return
401 _swift_package_config_get-mirror() {
403 "--package-url[The package dependency url]:The package dependency url: "
405 _arguments $arguments && return
408 _swift_package_config_set-mirror() {
410 "--package-url[The package dependency url]:The package dependency url: "
411 "--mirror-url[The mirror url]:The mirror url: "
413 _arguments $arguments && return
416 _swift_package_update() {
419 _arguments $arguments && return
422 # Generates completions for swift test
424 # In the final compdef file, set the following file header:
426 # #compdef _swift_test
427 # local context state state_descr line
428 # typeset -A opt_args
431 "-Xcc[Pass flag through to all C compiler invocations]:Pass flag through to all C compiler invocations: "
432 "-Xswiftc[Pass flag through to all Swift compiler invocations]:Pass flag through to all Swift compiler invocations: "
433 "-Xlinker[Pass flag through to all linker invocations]:Pass flag through to all linker invocations: "
434 "-Xcxx[Pass flag through to all C++ compiler invocations]:Pass flag through to all C++ compiler invocations: "
435 "(--configuration -c)"{--configuration,-c}"[Build with configuration (debug|release) ]: :{_values '' 'debug[build with DEBUG configuration]' 'release[build with RELEASE configuration]'}"
436 "--build-path[Specify build/cache directory ]:Specify build/cache directory :_files"
437 "(--chdir -C)"{--chdir,-C}"[]: :_files"
438 "--package-path[Change working directory before any other operation]:Change working directory before any other operation:_files"
439 "--sanitize[Turn on runtime checks for erroneous behavior]: :{_values '' 'address[enable Address sanitizer]' 'thread[enable Thread sanitizer]' 'undefined[enable Undefined Behavior sanitizer]'}"
440 "--disable-prefetching[]"
441 "--skip-update[Skip updating dependencies from their remote during a resolution]"
442 "--disable-sandbox[Disable using the sandbox when executing subprocesses]"
443 "--disable-package-manifest-caching[Disable caching Package.swift manifests]"
445 "--destination[]: :_files"
446 "(--verbose -v)"{--verbose,-v}"[Increase verbosity of informational output]"
447 "--no-static-swift-stdlib[Do not link Swift stdlib statically \[default\]]"
448 "--static-swift-stdlib[Link Swift stdlib statically]"
449 "--force-resolved-versions[]"
450 "--disable-automatic-resolution[Disable automatic resolution if Package.resolved file is out-of-date]"
451 "--enable-index-store[Enable indexing-while-building feature]"
452 "--disable-index-store[Disable indexing-while-building feature]"
453 "--enable-pubgrub-resolver[\[Experimental\] Enable the new Pubgrub dependency resolver]"
454 "--enable-parseable-module-interfaces[]"
456 "(--jobs -j)"{--jobs,-j}"[The number of jobs to spawn in parallel during the build process]:The number of jobs to spawn in parallel during the build process: "
457 "--enable-test-discovery[Enable test discovery on platforms without Objective-C runtime]"
458 "--skip-build[Skip building the test target]"
459 "(--list-tests -l)"{--list-tests,-l}"[Lists test methods in specifier format]"
460 "--generate-linuxmain[Generate LinuxMain.swift entries for the package]"
461 "--parallel[Run the tests in parallel.]"
462 "--num-workers[Number of tests to execute in parallel.]:Number of tests to execute in parallel.: "
463 "(--specifier -s)"{--specifier,-s}"[]: : "
464 "--xunit-output[]: :_files"
465 "--filter[Run test cases matching regular expression, Format: <test-target>.<test-case> or <test-target>.<test-case>/<test>]:Run test cases matching regular expression, Format: <test-target>.<test-case> or <test-target>.<test-case>/<test>: "
466 "--enable-code-coverage[Test with code coverage enabled]"
468 _arguments $arguments && return