rust-lang / rust-lang/rustup

"rustup add target ..." could warn user that they meant "rustup target add ..."

Open
#4,024 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Rust
Stars
7k
Forks
1.1k
Avg merge
22h 40m
Merged PRs (30d)
46

Description

Problem you are trying to solve

The following error message isn't as helpful as it could be:

$ rustup add target x86_64-unknown-linux-gnux32
error: unrecognized subcommand 'x86_64-unknown-linux-gnux32'

Usage: rustup target <COMMAND>

For more information, try '--help'.
Solution you'd like

I think it would be more useful if we added: Did you mean "rustup target add x86_64-unknown-linux-gnux32"?.

Notes

"add target" is the more natural language way of writing the command, so I feel we should help users who make this mistake.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at rustup's CLI handling for the add target command and inspect how the current unrecognized-subcommand error is produced. Look for existing tests covering command errors or suggestions, then verify that rustup add target <triple> reports the proposed rustup target add <triple> hint without changing valid command behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cli
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.