Skip to content

Commit

Permalink
Update QUICKSTART.md
Browse files Browse the repository at this point in the history
### Issue: Error in Command Using `cut` for Extracting Tool Names from `.tool-versions`

#### **Description:**

An error occurs when using the `cut` command to extract tool names from the `.tool-versions` file. The command is intended to automate adding ASDF plugins based on the tools listed in the `.tool-versions` file.

#### **Original Command:**

```bash
cut -d " " .tool-versions -f1
```

#### **Error Message:**

```plaintext
usage: cut -b list [-n] [file ...]
       cut -c list [file ...]
       cut -f list [-s] [-w | -d delim] [file ...]
```

#### **Cause:**

The error occurs because the `cut` command arguments are incorrectly ordered. Specifically, the filename `.tool-versions` is placed before the `-f1` option, leading `cut` to misinterpret the arguments and throw a usage error.

#### **Corrected Command:**

```bash
cut -d " " -f1 .tool-versions
```

#### **Explanation:**

- The delimiter (`-d " "`) should be specified before the field (`-f1`).
- The filename (`.tool-versions`) should be placed after all options.
  
This corrects the command, enabling it to properly extract the first field (tool names) from the `.tool-versions` file.

#### **Example Usage with ASDF:**

To automate adding ASDF plugins for each tool listed in `.tool-versions`:

```bash
for p in $(cut -d " " -f1 .tool-versions); do asdf plugin-add $p; done
```
  • Loading branch information
neeltom92 authored and ArchiFleKs committed Aug 11, 2024
1 parent ef9da65 commit 05e5295
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion QUICKSTART.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ requirement but our way of managing required tooling.
### Enabling plugins

```
for p in $(cut -d " " .tool-versions -f1); do asdf plugin add $p; done
for p in $(cut -d " " -f1 .tool-versions); do asdf plugin-add $p; done
```

### Installing tools
Expand Down

0 comments on commit 05e5295

Please sign in to comment.