Skip to content

Commit

Permalink
Document that the exit code indicates whether any unused dependency w…
Browse files Browse the repository at this point in the history
…as found (#72)
  • Loading branch information
bnjbvr authored Apr 6, 2023
1 parent 46c999d commit 01f6132
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Install `cargo-machete` with cargo:

`cargo install cargo-machete`

## Example
## Usage

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

The **return code** gives an indication whether unused dependencies have been found:

- 0 if machete found no unused dependencies,
- 1 if it found at least one unused dependency,
- 2 if there was an error during processing (in which case there's no indication whether any unused
dependency was found or not).

This can be used in CI situations.

### False positives

To ignore a certain set of dependencies in a crate, add
`package.metadata.cargo-machete` to `Cargo.toml`, and specify an `ignored` array:

Expand Down

0 comments on commit 01f6132

Please sign in to comment.