Skip to content

Commit 30e1821

Browse files
committed
feat: add extending cargo section
1 parent 6b7724d commit 30e1821

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

docs/docs/module1/2_command_line_tooling.md

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,4 +82,23 @@ Rust also has a command to check your application, rather than compiling you can
8282

8383
```sh
8484
cargo check
85-
```
85+
```
86+
87+
## Extending Cargo
88+
89+
Much like [.NET tools](https://learn.microsoft.com/en-us/dotnet/core/tools/global-tools) in the .NET CLI, which allow you to extend the functionality of the `dotnet` command. Cargo also supports similar functionality.
90+
91+
One of the most useful is `cargo watch`, which will sit and watch your file system for changes and automatically re-run `cargo check` whenever your code changes.
92+
93+
```sh
94+
cargo install cargo-watch
95+
cargo watch
96+
```
97+
98+
`cargo watch` also supports chaining, which means you can write things like:
99+
100+
```sh
101+
cargo watch -x check -x test
102+
```
103+
104+
Which will first run `cargo check`, if it completes successfully it will then automatically run `cargo test`.

0 commit comments

Comments
 (0)