Skip to content

Commit 6083aa2

Browse files
committed
Fix docs and help strings
1 parent 05ad223 commit 6083aa2

File tree

4 files changed

+8
-9
lines changed

4 files changed

+8
-9
lines changed

lib/defaults.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ const (
2828
DefaultMirror = "https://releases.hashicorp.com/terraform"
2929
DefaultLatest = ""
3030
installFile = "terraform"
31-
installDir = ".terraform.versions"
31+
InstallDir = ".terraform.versions"
3232
recentFile = "RECENT"
3333
tfDarwinArm64StartVersion = "1.0.2"
3434
VersionPrefix = "terraform_"

lib/param_parsing/parameters.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ func GetParameters() Params {
3535
getopt.StringVarLong(&params.CustomBinaryPath, "bin", 'b', "Custom binary path. Ex: tfswitch -b "+lib.ConvertExecutableExt("/Users/username/bin/terraform"))
3636
getopt.StringVarLong(&params.DefaultVersion, "default", 'd', "Default to this version in case no other versions could be detected. Ex: tfswitch --default 1.2.4")
3737
getopt.BoolVarLong(&params.HelpFlag, "help", 'h', "Displays help message")
38-
getopt.StringVarLong(&params.InstallPath, "install", 'i', "Custom install path. Ex: tfswitch -b "+lib.ConvertExecutableExt("/Users/username"))
38+
getopt.StringVarLong(&params.InstallPath, "install", 'i', "Custom install path. Ex: tfswitch -i /Users/username. The binaries will be in the sub installDir directory e.g. /Users/username/"+lib.InstallDir)
3939
getopt.BoolVarLong(&params.LatestFlag, "latest", 'u', "Get latest stable version")
4040
getopt.StringVarLong(&params.LatestPre, "latest-pre", 'p', "Latest pre-release implicit version. Ex: tfswitch --latest-pre 0.13 downloads 0.13.0-rc1 (latest)")
4141
getopt.StringVarLong(&params.LatestStable, "latest-stable", 's', "Latest implicit version based on a constraint. Ex: tfswitch --latest-stable 0.13.0 downloads 0.13.7 and 0.13 downloads 0.15.5 (latest)")

www/docs/usage/commandline.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@ The most recently selected versions are presented at the top of the dropdown.
2323

2424
## Use environment variables
2525

26-
You can also set the `TF_VERSION` environment variable to your desired terraform version.
27-
For example:
26+
You can also set the `TF_VERSION` environment variable to your desired terraform version. For example:
2827

2928
```bash
3029
export TF_VERSION=0.14.4
@@ -77,7 +76,7 @@ tfswitch --mirror https://example.jfrog.io/artifactory/hashicorp`
7776

7877
## Install to non-default location
7978

80-
By default `tfswitch` will download the Terraform binary to the user home directory under this path: `/Users/warrenveerasingam/.terraform.versions`
79+
By default `tfswitch` will download the Terraform binary to the user home directory under this path: `$HOME/.terraform.versions`
8180

8281
If you want to install the binaries outside of the home directory then you can provide the `-i` or `--install` to install Terraform binaries to a non-standard path. Useful if you want to install versions of Terraform that can be shared with multiple users.
8382

www/docs/usage/config-files.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,13 @@ This is similiar to using a .tfswitchrc file, but you can specify a custom binar
3636
![toml1](../static/tfswitch-v7.gif)
3737
![toml2](../static/tfswitch-v8.gif)
3838

39-
1. Create a custom binary path. Ex: `mkdir /Users/warrenveerasingam/bin` (replace warrenveerasingam with your username)
40-
2. Add the path to your PATH. Ex: `export PATH=$PATH:/Users/warrenveerasingam/bin` (add this to your bash profile or zsh profile)
41-
3. Pass -b or --bin parameter with your custom path to install terraform. Ex: `tfswitch -b /Users/warrenveerasingam/bin/terraform 0.10.8 `
39+
1. Create a custom binary path. Ex: `mkdir $HOME/bin` (replace warrenveerasingam with your username)
40+
2. Add the path to your PATH. Ex: `export PATH=$PATH:$HOME/bin` (add this to your bash profile or zsh profile)
41+
3. Pass -b or --bin parameter with your custom path to install terraform. Ex: `tfswitch -b $HOME/bin/terraform 0.10.8 `
4242
4. Optionally, you can create a `.tfswitch.toml` file in your terraform directory(current directory) OR in your home directory(~/.tfswitch.toml). The toml file in the current directory has a higher precedence than toml file in the home directory
4343
5. Your `.tfswitch.toml` file should look like this:
4444
```ruby
45-
bin = "/Users/warrenveerasingam/bin/terraform"
45+
bin = "$HOME/bin/terraform"
4646
version = "0.11.3"
4747
```
4848
4. Run `tfswitch` and it should automatically install the required terraform version in the specified binary path

0 commit comments

Comments
 (0)