|
1 | 1 | # clang-tools-manager |
2 | 2 |
|
| 3 | +[![crates.io][crates-io-badge]][crates-io-link] |
| 4 | +[![CHANGELOG][changelog-badge]][changelog-link] |
| 5 | + |
3 | 6 | A Rust crate to ensure clang-format and/or clang-tidy are installed. |
4 | 7 |
|
5 | | -This is a utility for cpp-linter CLI, |
6 | | -thus its API is considered internal to cpp-linter crate. |
| 8 | +This is a utility for [cpp-linter] CLI, |
| 9 | +thus its API is considered internal to [cpp-linter] crate. |
| 10 | + |
| 11 | +## Binary executable |
| 12 | + |
| 13 | +This crate comes with a `clang-tools` executable binary. |
| 14 | +It can be installed using |
| 15 | + |
| 16 | +```sh |
| 17 | +cargo install clang-tools-manager --locked --features bin |
| 18 | +``` |
| 19 | + |
| 20 | +Or using [cargo-binstall] to download pre-built binary executable: |
| 21 | + |
| 22 | +```sh |
| 23 | +cargo binstall clang-tools-manager |
| 24 | +``` |
7 | 25 |
|
8 | | -To run the binary for this crate (from git source): |
| 26 | +To run the executable from a checked out `git clone`: |
9 | 27 |
|
10 | 28 | ```text |
11 | 29 | cargo run --bin clang-tools --features bin -- --help |
12 | 30 | ``` |
| 31 | + |
| 32 | +[cpp-linter]: https://crates.io/crates/cpp-linter |
| 33 | +[cargo-binstall]: https://github.com/cargo-bins/cargo-binstall |
| 34 | + |
| 35 | +### CLI |
| 36 | + |
| 37 | +The `clang-tools` binary's Command Line Interface (CLI) is rather simple. |
| 38 | + |
| 39 | +<!-- markdownlint-disable MD033 --> |
| 40 | + |
| 41 | +<details><summary><code>clang-tools --help</code></summary> |
| 42 | +<p> |
| 43 | + |
| 44 | +```sh |
| 45 | +Usage: clang-tools [OPTIONS] |
| 46 | + |
| 47 | +Options: |
| 48 | + -v, --version [<VERSION>] |
| 49 | + The desired version of clang to install |
| 50 | + |
| 51 | + [default: ""] |
| 52 | + |
| 53 | + -V, --verbose |
| 54 | + Enable verbose logging for debugging purposes. |
| 55 | + |
| 56 | + This will include more DEBUG level log messages. |
| 57 | + Without it, log level is set to INFO by default. |
| 58 | + |
| 59 | + -t, --tool <TOOL> |
| 60 | + The clang tool to install |
| 61 | + |
| 62 | + [default: "clang-format clang-tidy"] |
| 63 | + [possible values: clang-tidy, clang-format] |
| 64 | + |
| 65 | + -d, --directory <DIRECTORY> |
| 66 | + The directory where the clang tools should be installed |
| 67 | + |
| 68 | + -f, --force |
| 69 | + Force overwriting symlink to the installed binary. |
| 70 | + |
| 71 | + This will only overwrite an existing symlink. |
| 72 | + |
| 73 | + -h, --help |
| 74 | + Print help (see a summary with '-h') |
| 75 | +``` |
| 76 | + |
| 77 | +</p> |
| 78 | +</details> |
| 79 | + |
| 80 | +For example, to install version 21 of clang-format and clang-tidy: |
| 81 | + |
| 82 | +```sh |
| 83 | +clang-tools --version 21 |
| 84 | +``` |
| 85 | + |
| 86 | +[crates-io-badge]: https://img.shields.io/crates/v/clang-tools-manager |
| 87 | +[crates-io-link]: https://crates.io/crates/clang-tools-manager |
| 88 | +[changelog-badge]: https://img.shields.io/badge/keep_a_change_log-v1.1.0-ffec3d |
| 89 | +[changelog-link]: https://github.com/cpp-linter/cpp-linter-rs/tree/main/clang-tools-manager/CHANGELOG.md |
0 commit comments