asdf-vm / asdf-vm/asdf

bug: `asdf current <name>` outputs more than just the current version

Open
#1,469 5 comments 8 reactions 0 assignees View on GitHub
bug
Dominant language
Go
Stars
25.6k
Forks
941
Avg merge
9h 24m
Merged PRs (30d)
3

Description

### Describe the Bug

The `asdf current ` command does more than just "display current version set or being used for package" as the help message says. Also, this command in the documentation does not work due to that:

https://github.com/asdf-vm/asdf/blob/a91b6d0ee3bc87af0af3cd4b29dd74695e8026b8/docs/manage/versions.md?plain=1#L150

I could not track how far the behavior changed, if it changed at all, or if the documentation was just wrong since the beginning.

It would be handy to have a raw output of just the version so it could be used as the example. A use case I have is trying to check if the `system` version of `direnv` is currently being used or not (for [this](https://github.com/zimfw/asdf/issues/3)).

EDIT: I see `asdf where` will already output the install path of the current version installed if no specific version is given, so the documentation should be updated. I'll submit a PR for that.

### Steps to Reproduce

1. `asdf current direnv`

### Expected Behaviour

```
2.32.2
```

### Actual Behaviour

```
direnv 2.32.2 /path/to/.tool-versions
```

### Environment

```shell
OS:
Darwin me.local 21.6.0 Darwin Kernel Version 21.6.0: Mon Dec 19 20:44:01 PST 2022; root:xnu-8020.240.18~2/RELEASE_X86_64 x86_64

SHELL:
zsh 5.9 (x86_64-apple-darwin21.3.0)

ASDF VERSION:
v0.11.1

ASDF ENVIRONMENT VARIABLES:
ASDF_DIR=/usr/local/opt/asdf/libexec

ASDF INSTALLED PLUGINS:
direnv https://github.com/asdf-community/asdf-direnv.git master e3622e6
nodejs https://github.com/asdf-vm/asdf-nodejs.git master c9e5df4
python https://github.com/danhper/asdf-python.git master 8505457
```

### asdf plugins affected (if relevant)

_No response_

Contributor guide

Open the contributing guide

Research direction

Read docs/manage/versions.md around the linked example, then run `asdf current direnv` and compare it with `asdf where`. Update the documentation to use the working command and accurately describe its output; done means the example no longer relies on `asdf current ` producing only a version.

Written by the indexing model from the issue text.

Assessment

Tech stack
shell
Domain
cli, documentation
Issue type
Documentation
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.