Skip to content

Commit 10b08b2

Browse files
authored
broad swiftly-doc content edit pass (#268)
* broad content edit pass - switched article titles to not use capitals all across - made use of `swiftly` more consistently lower-case, including titles - revised language in a few places to remove future or past tense phrasing or to make the wording more direct. - broke up the paragraphs into one-sentence-per-line structure for easier reviewing. - fixed an odd typo. - tried to broadly maintain the existing voice, but remove some extra phrasing here and there and generally tighten up the content. * adding shell-autocompletion to see also section
1 parent fd32a53 commit 10b08b2

8 files changed

+113
-66
lines changed

Documentation/SwiftlyDocs.docc/SwiftlyDocs.md

+3
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ Install and manage your Swift programming language toolchains.
66
@DisplayName("Swiftly")
77
}
88

9+
Swiftly helps you to easily install different Swift toolchains locally on your account.
10+
It provides a single path to install, update, remove, or run commands with a specific Swift toolchain.
11+
912
## Topics
1013

1114
- <doc:getting-started>
Original file line numberDiff line numberDiff line change
@@ -1,75 +1,94 @@
1-
# Install Swiftly Automatically
1+
# Install swiftly automatically
22

33
Automatically install swiftly and Swift toolchains.
44

55
This guide helps you to automate the installation of swiftly and toolchains so that it can run unattended, for example in build or continous integration systems.
6-
We assume that you have working understanding of your build system. The examples are based on a typical Unix environment.
6+
This guide assumes that you have working understanding of your build system.
7+
The examples are based on a typical Unix environment.
78

8-
First, download the swiftly binary from swift.org for your operating system (e.g. Linux) and processor architecture (e.g. arm64, or x86_64). Here's an example using the popular curl command.
9+
### Download the binary
10+
11+
First, download the swiftly binary from swift.org for your operating system (for example, Linux) and processor architecture (for example `arm64` or `x86_64`).
12+
Here's an example using the popular curl command.
913

1014
```
11-
curl -L <location_of_swiftly_swift_org> > swiftly.tar.gz
15+
curl -L https://download.swift.org/swiftly/linux/swiftly-$(uname -m).tar.gz > swiftly.tar.gz
1216
tar zxf swiftly.tar.gz
1317
```
1418

15-
On macOS you can download the pkg file and extract it like this from the command-line:
19+
On macOS, download the pkg file and extract it like this from the command-line:
1620

1721
```
18-
curl -L <location_of_swiftly_swift_org> > swiftly.pkg
22+
curl -L https://download.swift.org/swiftly/darwin/swiftly.pkg > swiftly.pkg
1923
installer -pkg swiftly.pkg -target CurrentUserHomeDirectory
2024
```
2125

22-
> Tip: If you are using Linux you will need the "ca-certificates" package for the root certificate authorities that will establish the trust that swiftly needs to make API requests that it needs. This package is frequently pre-installed on end-user environments, but may not be present in more minimal installations.
26+
> Tip: If you are using Linux you will need GPG and the "ca-certificates" package for the root certificate authorities that will establish the trust that swiftly needs to make API requests that it needs. This package is frequently pre-installed on end-user environments, but may not be present in more minimal installations.
27+
28+
### Install swiftly
2329

24-
Once swiftly is downloaded you can run the init subcommand to finish the installation. This command will print verbose outputs, assume yes for all prompts, and skip the automatic installation of the latest swift toolchain:
30+
Once swiftly is downloaded, run the `init` subcommand to finish the installation.
31+
The following example command prints verbose outputs, assume yes for all prompts, and skips the automatic installation of the latest swift toolchain:
2532

2633
```
2734
./swiftly init --verbose --assume-yes --skip-install # the swiftly binary is extracted to ~/local/bin/swiftly on macOS
2835
```
2936

30-
Swiftly is installed, but the current shell may not yet be updated with the new environment variables, such as the PATH. The init command prints instructions on how to update the current shell environment without opening a new shell. This is an example of the output taken from Linux, but the details might be different for other OSes, username, or shell.
37+
Swiftly is installed, but the current shell may not yet be updated with the new environment variables, such as `PATH`.
38+
The `init` command prints instructions on how to update the current shell environment without opening a new shell.
39+
The following output is an example from Linux, the details might be different for other OSes, username, or shell:
3140

3241
```
3342
To begin using installed swiftly from your current shell, first run the following command:
3443
3544
. "/root/.local/share/swiftly/env.sh"
3645
```
3746

38-
> Note: on macOS systems you may need to run 'hash -r' to recalculate the zsh PATH cache when installing swiftly and toolchains.
47+
> Note: on macOS, run 'hash -r' to recalculate the zsh PATH cache when installing swiftly and toolchains.
48+
49+
You can go ahead and add this command to the list of commands in your build script so that the build can proceed to call swiftly from the path.
50+
51+
### Install a toolchain
3952

40-
You can go ahead and add this command to the list of commands in your build script so that the build can proceed to call swiftly from the path. The usual next step is to install a specific swift toolchain like this:
53+
The usual next step is to install a specific swift toolchain using the `install` command with the `--post-install-file` option:
4154

4255
```
4356
swiftly install 5.10.1 --post-install-file=post-install.sh
4457
```
4558

46-
It's possible that there will be some post-installation steps to prepare the build system for using the swift toolchain. The `post-install-file` option gives a file, post-install.sh, that is created if there are post installation steps for this toolchain. You can check if the file exists and run it to perform those final steps. If the build runs as the root user you can check it and run it like this in a typical Unix shell:
59+
It's possible that there will be some post-installation steps to prepare the system for using the swift toolchain.
60+
If additional post-install steps are needed to use the toolchain they are written to the file you specified; `post-install.sh` in the example above.
61+
You can check if the file exists and run it to perform those final steps.
62+
If the build runs as the root user you can check it and run it like this in a typical Unix shell:
4763

4864
```
4965
if [ -f post-install.sh ]; then
5066
. post-install.sh
5167
fi
5268
```
5369

54-
> Note: If the build system runs your script as a regular user then you will need to take this into account by either pre-installing the toolchain's system dependencies or running the `post-install.sh` script in a secure manner as the administrative user.
70+
> Note: If the system runs your script as a regular user then you will need to take this into account by either pre-installing the toolchain's system dependencies or running the `post-install.sh` script in a secure manner as the administrative user.
71+
72+
### Customize the installation
5573

5674
If you want to install swiftly, or the binaries that it manages into different locations these can be customized using environment variables before running `swiftly init`.
5775

58-
```
59-
SWIFTLY_HOME_DIR - The location of the swiftly configuration files, and environment scripts
60-
SWIFTLY_BIN_DIR - The location of the swiftly binary and toolchain symbolic links (e.g. swift, swiftc, etc.)
61-
```
76+
- term `SWIFTLY_HOME_DIR`: The location of the swiftly configuration files, and environment scripts
77+
- term `SWIFTLY_BIN_DIR`: The location of the swiftly binary and toolchain symbolic links (for example swift, swiftc, and so on)
6278

63-
Sometimes the build system platform can't be automatically detected, or isn't supported by swift. You can provide the platform as an option to the swiftly init subcommand:
79+
Sometimes swiftly can't automatically detect the system platform, or isn't supported by swift.
80+
You can provide the platform as an option to the `swiftly init` subcommand:
6481

6582
```
6683
swiftly init --platform=<platform_name>
6784
```
6885

69-
There are other customizable options, such as overwrite. For more details about the available options, check the help:
86+
There are other customizable options, such as overwrite.
87+
For more details about the available options, check the help:
7088

7189
```
7290
swiftly init --help
7391
```
7492

75-
In summary, swiftly can be installed and install toolchains unattended on build and CI-style systems. This HOWTO guide has outlined the process to script the process covering some of the different options available to you.
93+
In summary, swiftly can be installed and install toolchains unattended on build and CI-style systems.
94+
This guide has outlined the process to script the process covering some of the different options available to you.

Documentation/SwiftlyDocs.docc/getting-started.md

+18-12
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
1-
# Getting Started with Swiftly
1+
# Getting started with swiftly
22

3-
Start using swiftly and swift.
3+
Start using swiftly and Swift.
44

55
To get started with swiftly you can download it from [swift.org](https://swift.org/download), and extract the package.
66

77
@TabNavigator {
88
@Tab("Linux") {
9-
If you are using Linux then you can verify and extract the archive like this:
9+
If you are using Linux then you can download the binary:
1010

1111
```
12-
tar zxf swiftly-x.y.z.tar.gz
12+
curl -L https://download.swift.org/swiftly/linux/swiftly-$(uname -m).tar.gz > swiftly.tar.gz
13+
tar zxf swiftly.tar.gz
1314
```
1415

1516
Now run swiftly init to finish the installation:
@@ -20,21 +21,24 @@ To get started with swiftly you can download it from [swift.org](https://swift.o
2021
}
2122

2223
@Tab("macOS") {
23-
On macOS you can either run the pkg installer from the command-line like this or just run the package by double-clicking on it (not recommended):
24+
On macOS you can either run the pkg installer from the command-line like this or run the package by double-clicking on it (not recommended):
2425

2526
```
26-
installer -pkg swift-x.y.z.pkg -target CurrentUserHomeDirectory
27+
curl -L https://download.swift.org/swiftly/darwin/swiftly.pkg > swiftly.pkg
28+
installer -pkg swiftly.pkg -target CurrentUserHomeDirectory
2729
```
2830

29-
Now run swiftly init to finish the installation:
31+
Once the package is installed, run `swiftly init` to finish the installation:
3032

3133
```
32-
~/usr/local/bin/swiftly init
34+
~/.swiftly/bin/swiftly init
3335
```
3436
}
3537
}
3638

37-
Swiftly will install itself and download the latest available Swift toolchain. Follow the prompts for any additional steps. Once everything is done you can begin using swift.
39+
Swiftly installs itself and downloads the latest available Swift toolchain.
40+
Follow the prompts for any additional steps that may be required.
41+
Once everything is done you can begin using swift.
3842

3943
```
4044
$ swift --version
@@ -72,20 +76,22 @@ Uninstall this toolchain after you're finished with it:
7276
$ swiftly uninstall main-snapshot
7377
```
7478

75-
# Proxy
79+
## Installing toolchains through an HTTP proxy
7680

7781
Swiftly downloads a list of toolchains from https://www.swift.org/ and retrieves them from CDN via https://download.swift.org.
78-
If your environment requires a proxy, Swiftly will attempt to use the standard environment variables `http_proxy`, `HTTP_PROXY`, `https_proxy` or `HTTPS_PROXY` to determine which proxy server to use instead of making a direct connection.
82+
If your environment requires a proxy, Swiftly attempts to use the standard environment variables `http_proxy`, `HTTP_PROXY`, `https_proxy` or `HTTPS_PROXY` to determine which proxy server to use instead of making a direct connection.
7983

8084
To download latest nightly snapshot using a proxy:
8185
```
8286
$ export https_proxy=http://proxy:3128
8387
$ swiftly install main-snapshot
8488
```
8589

86-
# See Also:
90+
## See Also:
8791

92+
- [Add shell autocompletions](shell-autocompletion)
8893
- [Install Toolchains](install-toolchains)
8994
- [Using Toolchains](use-toolchains)
9095
- [Uninstall Toolchains](uninstall-toolchains)
9196
- [Swiftly CLI Reference](swiftly-cli-reference)
97+

Documentation/SwiftlyDocs.docc/install-toolchains.md

+11-7
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
1-
# Install Swift Toolchains
1+
# Install Swift toolchains
22

33
Install swift toolchains with Swiftly.
44

5-
Installing a swift toolchain using swiftly involves downloading it securely and extracting it into a well-known location in your account. Here we will guide you through the different ways you can install a swift toolchain. You will need to install swiftly first. The [Getting Started](getting-started.md) guide is a good place to start with swiftly.
5+
Installing a swift toolchain using swiftly involves downloading it securely and extracting it into a well-known location in your account.
6+
This guides you through the different ways you can install a swift toolchain.
7+
Follow the [Getting Started](getting-started.md) guide to install swiftly.
68

79
The easiest way to install a swift toolchain is to select the latest stable release:
810

911
```
1012
$ swiftly install latest
1113
```
1214

13-
> Note: After you install a toolchain there may be certain system dependencies that are needed. Swiftly will provide instructions.
15+
> Note: After you install a toolchain there may be certain system dependencies that are needed.
16+
Swiftly provides instructions for any additional dependencies that need to be installed.
1417

15-
If this is the only toolchain that is installed then swiftly will automatically "use" it so that when you run swift (or any other toolchain command) it will be this version.
18+
If this is the only installed toolchain, swiftly automatically uses it. When you run `swift` (or another toolchain command), it uses the installed version.
1619

1720
```
1821
$ swift --version
@@ -21,7 +24,8 @@ Swift version 5.8.1 (swift-5.8.1-RELEASE)
2124
Target: x86_64-unknown-linux-gnu
2225
```
2326

24-
You can be very specific about the released version that you want. We can install the 5.6.1 version like this:
27+
You can be very specific about the released version to install.
28+
For example, the following command installs the 5.6.1 toolchain version:
2529

2630
```
2731
$ swiftly install 5.6.1
@@ -33,13 +37,13 @@ Once you've installed more than one toolchain you may notice that swift is on th
3337
$ swiftly use 5.6.1
3438
```
3539

36-
You can also combine install and use into one command to automate this process with the `--use` switch on the install subcommand:
40+
You can combine `install` and `use` into one command with the `--use` switch on the `install` subcommand:
3741

3842
```
3943
$ swiftly install --use 5.7.1
4044
```
4145

42-
Sometimes you want the latest available patch of a minor release, such as 5.7. Let's omit the patch number so that we get the latest patch.
46+
Sometimes you want the latest available patch of a minor release, such as 5.7. If you omit the patch number from the release you request, swiftly installs the latest patch.
4347

4448
```
4549
$ swiftly install 5.7

Documentation/SwiftlyDocs.docc/shell-autocompletion.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
# Add Shell Auto-completions
1+
# Add shell auto-completions
22

3-
Generate shell auto-completions for Swiftly.
3+
Generate shell autocompletions for swiftly.
44

5-
Swiftly can generate shell auto-completion scripts for your shell to automatically complete subcommands, arguments, options and flags. It does this using the [swift-argument-parser](https://apple.github.io/swift-argument-parser/documentation/argumentparser/installingcompletionscripts/), which has support for Bash, Z shell, and Fish.
5+
Swiftly can generate shell autocompletion scripts for your shell to automatically complete subcommands, arguments, options and flags. It does this using the [swift-argument-parser](https://apple.github.io/swift-argument-parser/documentation/argumentparser/installingcompletionscripts/), which has support for Bash, Z shell, and Fish.
66

77
You can ask swiftly to generate the script using the hidden `--generate-completion-script` flag with the type of shell like this:
88

@@ -63,4 +63,4 @@ swiftly --generate-completion-script <shell>
6363
}
6464
}
6565

66-
Once you have installed the completions you can type out a swiftly command, and press a special key (e.g. tab) and the shell will show you the available subcommand, argument, or options to make it easier to assemble a working command-line.
66+
Once you have installed the completions you can type out a swiftly command, and press a special key (for example, tab) and the shell will show you the available subcommand, argument, or options to make it easier to assemble a working command-line.

Documentation/SwiftlyDocs.docc/uninstall-toolchains.md

+6-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
# Uninstall Swift Toolchains
1+
# Uninstall Swift toolchains
22

3-
Uninstall Swift toolchains.
3+
Remove unneeded Swift toolchains.
44

5-
After installing several toolchains the list of the available toolchains to use becomes too large. Each toolchain also occupies substantial storage space. It's good to be able to cleanup toolchains when they aren't needed anymore. This guide will cover how to uninstall your toolchains assuming that you have installed swiftly and used it to install them.
5+
After installing several toolchains the list of the available toolchains may become unwieldy, and each toolchain can occupy substantial storage space.
6+
This guide covers how to uninstall no longer needed toolchains that were installed with swiftly.
67

78
If you have a released version that you want to uninstall then give the exact three digit version (major, minor and patch):
89

@@ -23,14 +24,14 @@ $ swiftly uninstall main-snapshot-2022-08-30
2324
$ swiftly uninstall 5.7-snapshot-2022-08-30
2425
```
2526

26-
It can be time consuming to remove all of the snapshots that you have installed. You can remove all of the snapshots on a version, or main with one command.
27+
It can be time consuming to remove all of the snapshots that you have installed. You can remove all of the main or version snapshots with one command.
2728

2829
```
2930
$ swiftly uninstall main-snapshot
3031
$ swiftly uninstall 5.7-snapshot
3132
```
3233

33-
You can see what toolchahins remain with the list subcommand like this:
34+
You can see the installed toolchains that remain with the list subcommand:
3435

3536
```
3637
$ swiftly list

Documentation/SwiftlyDocs.docc/update-toolchain.md

+12-7
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,21 @@
1-
# Update Swift Toolchain
1+
# Update Swift toolchains
22

3-
Update swift toolchains.
3+
Update installed toolchains.
44

5-
Update replaces a given toolchain with a later version of that toolchain. For a stable release, this means updating to a later patch, minor, or major version. For snapshots, this means updating to the most recently available snapshot. Swiftly can help you to keep up-to-date. We assume that you have installed swiftly and use it to manage your toolchains.
5+
Update replaces a given toolchain with a later version of that toolchain.
6+
For a stable release, this means updating to a later patch, minor, or major version.
7+
For snapshots, swiftly helps you stay up-to-date by updating to the most recently available snapshot.
8+
Swiftly only updates toolchains that it installed.
69

7-
If no version is provided, update will update the currently selected toolchain to its latest patch release if a release toolchain or the latest available snapshot if a snapshot. The newly installed version will be selected.
10+
If no version is provided, update updates the currently selected toolchain to its latest patch release if a release toolchain, or the latest available snapshot if a snapshot.
11+
The newly installed version is then activated to use.
812

913
```
1014
swiftly update
1115
```
1216

13-
To update the latest installed release version to the latest available release version, the “latest” version can be provided. Note that this may update the toolchain to the next minor or even major version.
17+
To update the latest installed release version to the latest available release version, use `latest` as the version.
18+
Note that this may update the toolchain to the next minor or even major version.
1419

1520
```
1621
swiftly update latest
@@ -28,13 +33,13 @@ If the major and minor version are specified, the latest installed toolchain ass
2833
swiftly update 5.3
2934
```
3035

31-
Similarly, to update the latest snapshot associated with a specific version, the “a.b-snapshotversion can be supplied:
36+
Similarly, to update the latest snapshot associated with a specific version, append `-snapshot` to the version. For example, the following command updates to the latest 5.3 snapshot version:
3237

3338
```
3439
swiftly update 5.3-snapshot
3540
```
3641

37-
You can also update the latest installed main snapshot to the latest available one by just providing `main-snapshot`:
42+
You can also update the latest installed main snapshot to the latest available one by providing `main-snapshot`:
3843

3944
```
4045
swiftly update main-snapshot

0 commit comments

Comments
 (0)