No version manager name reported in CLI output, consider adding it
- Dominant language
- Go
- Stars
- 25.6k
- Forks
- 941
- Avg merge
- 9h 24m
- Merged PRs (30d)
- 3
Description
### Is your feature request related to a problem? Please describe
Hi there, excuse the snarky issue title, but it would be nice if asdf introduced itself in directories where it can't find `.tool-versions` instead of printing a cryptic message (which appears partially broken) without attribution.
Otherwise this output message can be quite confusing:
```
$ npm outdated
No version is set for command npm
Consider adding one of the following versions in your config file at
nodejs 16.13.2
```
Clearly there's some missing text here, probably assuming a location to a `.tool-versions` could be interpolated at the end of the second to last line?
Formatting-wise, showing `nodejs 16.13.2` without any list formatting is an odd choice as well, since at different viewport width it appears to be the end of the sentence above.
### Describe the proposed solution
Change this message to this instead:
```
$ npm outdated
asdf found no installed version for command `npm`.
You can add a version in `.tool-versions`, the following version is available: nodejs 16.13.2
```
That's of course assuming there's no alternative configuration file, but that's nothing a good link to a documentation page on the website won't fix if needed.
### Describe similar `asdf` features and why they are not sufficient
Since asdf is intercepting this call to `npm` I don't think this relates to other asdf features.
### Describe other workarounds you've considered
The only workaround would be for someone to be aware of `which npm` or `which -a npm` which sadly may be a bit too much to ask in some cases.
In my case, I forgot I installed `asdf` while also using `volta` and a Homebrew-installed version of node. I know, I know, that's a bit silly but I don't think it's that rare considering [this StackOverflow thread](https://stackoverflow.com/questions/74935373/no-version-is-set-for-command-npm-tool-versions-file-missing)
Contributor guide
Research direction
The issue does not name a file or test; start by searching the repository for the exact “No version is set for command” message and identify the CLI entry point that formats it. Reproduce the output with `npm outdated`, then verify that the revised message identifies asdf, formats the available version clearly, and remains correct for commands other than npm.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- node.js
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100