Skip to content

Commit 01f6132

Browse files
authored
Document that the exit code indicates whether any unused dependency was found (#72)
1 parent 46c999d commit 01f6132

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

README.md

+12-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Install `cargo-machete` with cargo:
2626

2727
`cargo install cargo-machete`
2828

29-
## Example
29+
## Usage
3030

3131
Run cargo-machete in a directory that contains one or more Rust projects (using Cargo for
3232
dependency management):
@@ -39,6 +39,17 @@ cd my-directory && cargo machete
3939
cargo machete /absolute/path/to/my/directory
4040
```
4141

42+
The **return code** gives an indication whether unused dependencies have been found:
43+
44+
- 0 if machete found no unused dependencies,
45+
- 1 if it found at least one unused dependency,
46+
- 2 if there was an error during processing (in which case there's no indication whether any unused
47+
dependency was found or not).
48+
49+
This can be used in CI situations.
50+
51+
### False positives
52+
4253
To ignore a certain set of dependencies in a crate, add
4354
`package.metadata.cargo-machete` to `Cargo.toml`, and specify an `ignored` array:
4455

0 commit comments

Comments
 (0)