Skip to content

Commit 1774cd3

Browse files
author
Trevor Miranda
committed
Update README.md with information about rustup component commands and filters.
1 parent 7f347f2 commit 1774cd3

File tree

1 file changed

+42
-3
lines changed

1 file changed

+42
-3
lines changed

README.md

Lines changed: 42 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -481,6 +481,45 @@ default toolchain:
481481
rustup default system
482482
```
483483

484+
## Working with components
485+
486+
Components that enhance your default Rust toolchain, like `rustfmt`, can be
487+
installed like so:
488+
489+
```
490+
rustup component add rustfmt
491+
```
492+
493+
This will install `rustfmt` for the toolchain you have selected as your default
494+
using the `rustup toolchain default <toolchain>` command. If you want to see a list of the
495+
components that are available for your default toolchain, you can use:
496+
497+
```
498+
rustup component list --filter available
499+
```
500+
501+
This will list only the components that are available, without listing the
502+
components you have installed, or the ones that are required for your installed
503+
toolchain. If you want to filter by those particular statuses, the filter
504+
argument would look like:
505+
506+
```
507+
rustup component list --filter required
508+
```
509+
510+
or
511+
512+
```
513+
rustup component list --filter installed
514+
```
515+
516+
Required components are components that are required for you to compile Rust
517+
projects using the toolchain you have selected as your default. These are
518+
components like `rust-std`, `rust-doc`, `rustc`, and `cargo`. Installed
519+
components include required components, and are all components that you have
520+
installed. This includes non-critical components like `rustfmt` or `clippy`,
521+
which you may have installed previously.
522+
484523
## Working with custom toolchains and local builds
485524

486525
For convenience of developers working on Rust itself, `rustup` can manage
@@ -530,9 +569,9 @@ If you need a more complex setup, rustup supports the convention used by
530569
the __curl__ program, documented in the ENVIRONMENT section of
531570
[its manual page][curlman].
532571

533-
Note that some versions of `libcurl` apparently require you to drop the
534-
`http://` or `https://` prefix in environment variables. For example,
535-
`export http_proxy=proxy.example.com:1080` (and likewise for HTTPS).
572+
Note that some versions of `libcurl` apparently require you to drop the
573+
`http://` or `https://` prefix in environment variables. For example,
574+
`export http_proxy=proxy.example.com:1080` (and likewise for HTTPS).
536575
If you are getting an SSL `unknown protocol` error from `rustup` via `libcurl`
537576
but the command-line `curl` command works fine, this may be the problem.
538577

0 commit comments

Comments
 (0)