<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><meta http-equiv="Content-Type" content="text/html charset=us-ascii" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="box-sizing: border-box; -webkit-margin-before: 1rem; -webkit-margin-after: 1rem; -webkit-margin-start: 0px; -webkit-margin-end: 0px; margin: 0.8em 0px; width: inherit; position: relative; color: rgb(51, 51, 51); font-family: 'Open Sans', 'Clear Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif; white-space: pre-wrap;" class=""><span style="font-size: 16px;" class="">Hi all,</span></div><div style="box-sizing: border-box; -webkit-margin-before: 1rem; -webkit-margin-after: 1rem; -webkit-margin-start: 0px; -webkit-margin-end: 0px; margin: 0.8em 0px; width: inherit; position: relative; color: rgb(51, 51, 51); font-family: 'Open Sans', 'Clear Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif; white-space: pre-wrap;" class=""><span style="font-size: 16px;" class="">Some time ago I've provided SwiftPM with shell completion scripts (see PR <a href="https://github.com/apple/swift-package-manager/pull/703" target="_blank" style="box-sizing: border-box; cursor: pointer; color: rgb(65, 131, 196);" class="">#703</a>) for both Bash and ZSH. These completions are quite useful as shown in the following gifs;</span></div><span style="color: rgb(51, 51, 51); font-family: 'Open Sans', 'Clear Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 16px; white-space: pre-wrap;" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">ZSH: <a href="https://cloud.githubusercontent.com/assets/235882/18910036/805fb40a-8576-11e6-98ff-2114c9997bf6.gif" class="">https://cloud.githubusercontent.com/assets/235882/18910036/805fb40a-8576-11e6-98ff-2114c9997bf6.gif</a></div></span></div><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><span style="color: rgb(51, 51, 51); font-family: 'Open Sans', 'Clear Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 16px; white-space: pre-wrap;" class="">Bash: <a href="https://cloud.githubusercontent.com/assets/235882/18910038/8468299c-8576-11e6-954e-7b6c5749bba9.gif" class="">https://cloud.githubusercontent.com/assets/235882/18910038/8468299c-8576-11e6-954e-7b6c5749bba9.gif</a></span></div><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="box-sizing: border-box; -webkit-margin-before: 1rem; -webkit-margin-after: 1rem; -webkit-margin-start: 0px; -webkit-margin-end: 0px; margin: 0.8em 0px; width: inherit; position: relative; color: rgb(51, 51, 51); font-family: 'Open Sans', 'Clear Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 16px; white-space: pre-wrap;" class="">They are currently included with the SwiftPM project (see <a href="https://github.com/apple/swift-package-manager/blob/master/Utilities/zsh/_swift" class="">ZSH</a> and <a href="https://github.com/apple/swift-package-manager/blob/master/Utilities/bash/completions" target="_blank" style="box-sizing: border-box; cursor: pointer; color: rgb(65, 131, 196);" class="">Bash</a>), but only available to those that checkout the SwiftPM repository. That's a pity because the completion scripts are very useful to beginners learning Swift to explore available commands and flags, but also speeds up experienced Swift users on the command line.</div><div style="box-sizing: border-box; -webkit-margin-before: 1rem; -webkit-margin-after: 1rem; -webkit-margin-start: 0px; -webkit-margin-end: 0px; margin: 0.8em 0px; width: inherit; position: relative; color: rgb(51, 51, 51); font-family: 'Open Sans', 'Clear Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 16px; white-space: pre-wrap;" class="">In order to reach the complete Swift community, I'd like to provide these scripts with the toolchain. In order to do this, I propose adding two files inside the toolchain at a location similar to the builtin completion scripts:</div><pre class="md-fences mock-cm" style="box-sizing: border-box; white-space: pre-wrap; font-size: 0.9em; break-inside: avoid; overflow: visible; background-image: inherit; background-size: inherit; background-attachment: inherit; background-origin: inherit; background-clip: inherit; background-color: rgb(248, 248, 248); position: relative; border: 1px solid rgb(221, 221, 221); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; font-family: Consolas, 'Liberation Mono', Courier, monospace; padding: 8px 1em 6px; margin-bottom: 15px; margin-top: 15px; width: inherit; color: rgb(51, 51, 51);">/usr/local/share/zsh/functions/_swift
/usr/local/share/bash-completion/completions/swift</pre><div style="box-sizing: border-box; -webkit-margin-before: 1rem; -webkit-margin-after: 1rem; -webkit-margin-start: 0px; -webkit-margin-end: 0px; margin: 0.8em 0px; width: inherit; position: relative; color: rgb(51, 51, 51); font-family: 'Open Sans', 'Clear Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 16px; white-space: pre-wrap;" class="">In order to keep these files up-to-date, I've written a SwiftPM command that generates these completions files, based on the arguments available to the various <code style="box-sizing: border-box; border: 1px solid rgb(221, 221, 221); background-color: rgb(248, 248, 248); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; font-family: Consolas, 'Liberation Mono', Courier, monospace; padding: 2px 4px 0px; font-size: 0.9em;" class="">SwiftTool<></code> commands. At the moment the compiler flags are hard-coded, but I'm sure we can also find a way to provide these as well. PR <a href="https://github.com/apple/swift-package-manager/pull/1256" target="_blank" style="box-sizing: border-box; cursor: pointer; color: rgb(65, 131, 196);" class="">#1256</a> is the shell completion script generator and PR <a href="https://github.com/apple/swift-package-manager/pull/1257" target="_blank" style="box-sizing: border-box; cursor: pointer; color: rgb(65, 131, 196);" class="">#1257</a> is the output of that generator.</div><div style="box-sizing: border-box; -webkit-margin-before: 1rem; -webkit-margin-after: 1rem; -webkit-margin-start: 0px; -webkit-margin-end: 0px; margin: 0.8em 0px; width: inherit; position: relative; color: rgb(51, 51, 51); font-family: 'Open Sans', 'Clear Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 16px; white-space: pre-wrap;" class="">I'd like to get some input in whether and how we can include these scripts / files into the toolchain; how to automate the script generation such that they remain up-to-date with every Swift release; and a way to make users aware of these scripts -- instructions on how to enable them for their shell.</div><div style="box-sizing: border-box; -webkit-margin-before: 1rem; -webkit-margin-after: 1rem; -webkit-margin-start: 0px; -webkit-margin-end: 0px; margin: 0.8em 0px; width: inherit; position: relative; color: rgb(51, 51, 51); font-family: 'Open Sans', 'Clear Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 16px; white-space: pre-wrap;" class="">--
Thanks,
Bouke</div></div></body></html>