Skip to content

Commit

Permalink
Merge pull request #3 from tfversion/docs/unalias-and-current
Browse files Browse the repository at this point in the history
Add the new options and commands to the docs
  • Loading branch information
ChrisTerBeke committed Mar 8, 2024
2 parents 3b0cd0b + 252f8ca commit 35dceb1
Showing 1 changed file with 41 additions and 12 deletions.
53 changes: 41 additions & 12 deletions docs/use.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,6 @@ tfversion install --required

Once you have installed a Terraform version, you can activate it with the `use` command.

> Note: When using a version, it must always be installed first!
### Use latest stable

Use the latest stable version.
Expand Down Expand Up @@ -86,6 +84,15 @@ Use the most recent version that matches with the required version in your curre
tfversion use --required
```

### Automatically install when missing

Use a version and automatically install if you don't have it yet.

```sh
tfversion use 1.7.4 --install
tfversion use --latest --install
```

## Alias

If you don't want to remember which version you are using for a specific purpose (for example a client), you can use the alias feature.
Expand All @@ -108,6 +115,16 @@ tfversion use default
tfversion use my-client
```

## Unalias

You can remove an alias once you're done with it.

### Remove an alias

```sh
tfversion unalias my-client
```

## List

If you're curious which Terraform versions are available or installed, you can use the `list` command.
Expand All @@ -120,32 +137,36 @@ Shows all available versions from the HashiCorp API sorted with the most recent
tfversion list
```

You can limit the amount of results.
### List all installed versions

Shows all installed versions.

```sh
tfversion list --max-results=10
tfversion list --installed
```

### List all installed versions
### List aliases

Shows all installed versions.
Shows all aliases and their target versions.

```sh
tfversion list --installed
tfversion list --aliases
```

You can limit the amount of results.
### List pre-release versions

Shows all pre-release versions.

```sh
tfversion list --installed --max-results=10
tfversion list --pre-release
```

### List aliases
### Limit results

Shows all aliases and their target versions.
You can limit the amount of results in any `list` command.

```sh
tfversion list --aliases
tfversion list --max-results=10
```

## Uninstall
Expand All @@ -155,3 +176,11 @@ If you want to remove a Terraform version, you can use the `uninstall` command.
```sh
tfversion uninstall 1.7.4
```

## Current

If you want to know which Terraform version is currently active.

```sh
tfversion current
```

0 comments on commit 35dceb1

Please sign in to comment.