cargo-search2
A binary utility that provides a more convenient version of cargo search.
Installation
Grab pre-built binaries for your platform from the releases page.
To grab releases in CI or other automation:
|
Install manually:
Examples
# output:
)
}
# Get an exact version or semver range
)
# Use --cache-version/-c to invalidate caches
)
)
# Step outputs for GitHub Actions
For an example GitHub Action, see .github/workflows/example.yml.
Why?
People sometimes use cargo search to generate cache keys for tools. This is an easier way to achieve the same goal with a
couple more features.
cargo search2 supports:
- looking for exact versions and semver ranges
- producing results in plain, JSON, and GitHub Actions formats
- easy cache invalidation through the
--cache-versionoption
Hash contents
The hashes produced by cargo search2 are derived from:
- The name of the crate
- The exact version number
- The cache version
Notably, the operating system and other parts of the environment are not part of the hash.
Stability guarantees
Within a semver range, the command-line interface is append-only, and hashes stay the same.
Contributing
Pull requests are welcome! Please follow the code of conduct.
License
This project is available under the terms of either the Apache 2.0 license or the MIT license.