This plugin provides a few utilities that make you faster on your daily work with the [Swift Package Manager](https://github.com/apple/swift-package-manager), as well as autocompletion for Swift 5.7.
This plugin provides a few utilities that make you faster on your daily work with the [Swift Package Manager](https://github.com/apple/swift-package-manager), as well as autocompletion for Swift 5.9.
To start using it, add the `swiftpm` plugin to your `plugins` array in `~/.zshrc`:
'--enable-signature-validation[Validate signature of a signed package release downloaded from registry]'
'--disable-signature-validation[Validate signature of a signed package release downloaded from registry]'
'--enable-prefetching'
'--disable-prefetching'
'(--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]'
@ -78,6 +85,7 @@ _swift_run() {
'--disable-scm-to-registry-transformation[disable source control to registry transformation]'
'--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]'
'--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]'
'--default-registry-url[Default registry URL to use, instead of the registries.json configuration file]:default-registry-url:'
'(--configuration -c)'{--configuration,-c}'[Build with configuration]:configuration:(debug release)'
'-Xcc[Pass flag through to all C compiler invocations]:Xcc:'
'-Xswiftc[Pass flag through to all Swift compiler invocations]:Xswiftc:'
@ -86,7 +94,7 @@ _swift_run() {
'--triple:triple:'
'--sdk:sdk:_files -/'
'--toolchain:toolchain:_files -/'
'--sanitize[Turn on runtime checks for erroneous behavior, possible values: address, thread, undefined, scudo]:sanitize:'
'--sanitize[Turn on runtime checks for erroneous behavior, possible values: address, thread, undefined, scudo]:sanitize:(address thread undefined scudo)'
'--auto-index-store[Enable or disable indexing-while-building feature]'
'--enable-index-store[Enable or disable indexing-while-building feature]'
'--disable-index-store[Enable or disable indexing-while-building feature]'
@ -94,8 +102,8 @@ _swift_run() {
'(--jobs -j)'{--jobs,-j}'[The number of jobs to spawn in parallel during the build process]:jobs:'
'--enable-signature-validation[Validate signature of a signed package release downloaded from registry]'
'--disable-signature-validation[Validate signature of a signed package release downloaded from registry]'
'--enable-prefetching'
'--disable-prefetching'
'(--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]'
@ -146,6 +161,7 @@ _swift_build() {
'--disable-scm-to-registry-transformation[disable source control to registry transformation]'
'--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]'
'--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]'
'--default-registry-url[Default registry URL to use, instead of the registries.json configuration file]:default-registry-url:'
'(--configuration -c)'{--configuration,-c}'[Build with configuration]:configuration:(debug release)'
'-Xcc[Pass flag through to all C compiler invocations]:Xcc:'
'-Xswiftc[Pass flag through to all Swift compiler invocations]:Xswiftc:'
@ -154,7 +170,7 @@ _swift_build() {
'--triple:triple:'
'--sdk:sdk:_files -/'
'--toolchain:toolchain:_files -/'
'--sanitize[Turn on runtime checks for erroneous behavior, possible values: address, thread, undefined, scudo]:sanitize:'
'--sanitize[Turn on runtime checks for erroneous behavior, possible values: address, thread, undefined, scudo]:sanitize:(address thread undefined scudo)'
'--auto-index-store[Enable or disable indexing-while-building feature]'
'--enable-index-store[Enable or disable indexing-while-building feature]'
'--disable-index-store[Enable or disable indexing-while-building feature]'
@ -162,8 +178,8 @@ _swift_build() {
'(--jobs -j)'{--jobs,-j}'[The number of jobs to spawn in parallel during the build process]:jobs:'
'--enable-signature-validation[Validate signature of a signed package release downloaded from registry]'
'--disable-signature-validation[Validate signature of a signed package release downloaded from registry]'
'--enable-prefetching'
'--disable-prefetching'
'(--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]'
@ -211,6 +235,7 @@ _swift_test() {
'--disable-scm-to-registry-transformation[disable source control to registry transformation]'
'--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]'
'--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]'
'--default-registry-url[Default registry URL to use, instead of the registries.json configuration file]:default-registry-url:'
'(--configuration -c)'{--configuration,-c}'[Build with configuration]:configuration:(debug release)'
'-Xcc[Pass flag through to all C compiler invocations]:Xcc:'
'-Xswiftc[Pass flag through to all Swift compiler invocations]:Xswiftc:'
@ -219,7 +244,7 @@ _swift_test() {
'--triple:triple:'
'--sdk:sdk:_files -/'
'--toolchain:toolchain:_files -/'
'--sanitize[Turn on runtime checks for erroneous behavior, possible values: address, thread, undefined, scudo]:sanitize:'
'--sanitize[Turn on runtime checks for erroneous behavior, possible values: address, thread, undefined, scudo]:sanitize:(address thread undefined scudo)'
'--auto-index-store[Enable or disable indexing-while-building feature]'
'--enable-index-store[Enable or disable indexing-while-building feature]'
'--disable-index-store[Enable or disable indexing-while-building feature]'
@ -227,29 +252,77 @@ _swift_test() {
'(--jobs -j)'{--jobs,-j}'[The number of jobs to spawn in parallel during the build process]:jobs:'
'--print-manifest-job-graph[Write the command graph for the build manifest as a graphviz file]'
'--build-system:build-system:(native xcode)'
'--enable-dead-strip[Disable/enable dead code stripping by the linker]'
'--disable-dead-strip[Disable/enable dead code stripping by the linker]'
'--static-swift-stdlib[Link Swift stdlib statically]'
'--no-static-swift-stdlib[Link Swift stdlib statically]'
'--skip-build[Skip building the test target]'
'--test-product[Test the specified product.]:test-product:'
'--parallel[Run the tests in parallel.]'
'--num-workers[Number of tests to execute in parallel.]:num-workers:'
'(--list-tests -l)'{--list-tests,-l}'[Lists test methods in specifier format]'
'--show-codecov-path[Print the path of the exported code coverage JSON file]'
'(--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]'
'(-s --specifier)'{-s,--specifier}':specifier:'
'--filter[Run test cases matching regular expression, Format: <test-target>.<test-case> or <test-target>.<test-case>/<test>]:filter:'
'--skip[Skip test cases matching regular expression, Example: --skip PerformanceTests]:skip:'
'--xunit-output[Path where the xUnit xml file should be generated.]:xunit-output:_files -/'
'--test-product[Test the specified product.]:test-product:'
'--enable-testable-imports[Enable or disable testable imports. Enabled by default.]'
'--disable-testable-imports[Enable or disable testable imports. Enabled by default.]'
'--enable-code-coverage[Enable code coverage]'
'--disable-code-coverage[Enable code coverage]'
'--version[Show the version.]'
'(-help -h --help)'{-help,-h,--help}'[Show help information.]'
'--enable-signature-validation[Validate signature of a signed package release downloaded from registry]'
'--disable-signature-validation[Validate signature of a signed package release downloaded from registry]'
'--enable-prefetching'
'--disable-prefetching'
'(--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]'
@ -286,6 +366,7 @@ _swift_package() {
'--disable-scm-to-registry-transformation[disable source control to registry transformation]'
'--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]'
'--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]'
'--default-registry-url[Default registry URL to use, instead of the registries.json configuration file]:default-registry-url:'
'(--configuration -c)'{--configuration,-c}'[Build with configuration]:configuration:(debug release)'
'-Xcc[Pass flag through to all C compiler invocations]:Xcc:'
'-Xswiftc[Pass flag through to all Swift compiler invocations]:Xswiftc:'
@ -294,7 +375,7 @@ _swift_package() {
'--triple:triple:'
'--sdk:sdk:_files -/'
'--toolchain:toolchain:_files -/'
'--sanitize[Turn on runtime checks for erroneous behavior, possible values: address, thread, undefined, scudo]:sanitize:'
'--sanitize[Turn on runtime checks for erroneous behavior, possible values: address, thread, undefined, scudo]:sanitize:(address thread undefined scudo)'
'--auto-index-store[Enable or disable indexing-while-building feature]'
'--enable-index-store[Enable or disable indexing-while-building feature]'
'--disable-index-store[Enable or disable indexing-while-building feature]'
@ -302,8 +383,8 @@ _swift_package() {
'(--jobs -j)'{--jobs,-j}'[The number of jobs to spawn in parallel during the build process]:jobs:'
'--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)'
'--skip-inherited-docs[Skip emitting doc comments for members inherited through classes or default implementations.]'
'--include-spi-symbols[Add symbols with SPI information to the symbol graph.]'
'--version[Show the version.]'
'(-help -h --help)'{-help,-h,--help}'[Show help information.]'
)
_arguments -w -s -S $args[@] && ret=0
return ret
}
_swift_package_dump-pif() {
integer ret=1
local -a args
args+=(
'--preserve-structure[Preserve the internal structure of PIF]'
'--emit-extension-block-symbols[Emit extension block symbols for extensions to external types or directly associate members and conformances with the extended nominal.]'
'--omit-extension-block-symbols[Emit extension block symbols for extensions to external types or directly associate members and conformances with the extended nominal.]'
'--version[Show the version.]'
'(-help -h --help)'{-help,-h,--help}'[Show help information.]'
)
@ -614,7 +634,7 @@ _swift_package_unedit() {
integer ret=1
local -a args
args+=(
'--force[Unedit the package even if it has uncommitted and unpushed changes]'
'--force[Unedit the package even if it has uncommited and unpushed changes]'
':package-name:'
'--version[Show the version.]'
'(-help -h --help)'{-help,-h,--help}'[Show help information.]'