Skip to content

Commit 0b3167b

Browse files
authored
docs: expand clang-tools-manager/README (#366)
resolves #351 - adds badges - adds simple CLI info (with example and copied `--help` output)
1 parent 790bc1d commit 0b3167b

2 files changed

Lines changed: 90 additions & 4 deletions

File tree

clang-tools-manager/README.md

Lines changed: 80 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,89 @@
11
# clang-tools-manager
22

3+
[![crates.io][crates-io-badge]][crates-io-link]
4+
[![CHANGELOG][changelog-badge]][changelog-link]
5+
36
A Rust crate to ensure clang-format and/or clang-tidy are installed.
47

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+
```
725

8-
To run the binary for this crate (from git source):
26+
To run the executable from a checked out `git clone`:
927

1028
```text
1129
cargo run --bin clang-tools --features bin -- --help
1230
```
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

cpp-linter/README.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11

22
# cpp-linter
33

4+
[![crates.io][crates-io-badge]][crates-io-link]
5+
[![docs.rs][docs-badge]][docs-link]
6+
[![CHANGELOG][changelog-badge]][changelog-link]
7+
48
This crate contains the the library used as a backend for the
59
`cpp-linter` binary executable. The main focus of `cpp-linter` is as follows:
610

@@ -14,5 +18,10 @@ This crate contains the the library used as a backend for the
1418

1519
See also the [CLI document hosted on github][gh-pages].
1620

17-
[pypi-org]: https://pypi.org/project/cpp-linter
1821
[gh-pages]: https://cpp-linter.github.io/cpp-linter-rs/cli.html
22+
[crates-io-badge]: https://img.shields.io/crates/v/cpp-linter
23+
[crates-io-link]: https://crates.io/crates/cpp-linter
24+
[docs-badge]: https://img.shields.io/docsrs/cpp-linter
25+
[docs-link]: https://docs.rs/cpp-linter
26+
[changelog-badge]: https://img.shields.io/badge/keep_a_change_log-v1.1.0-ffec3d
27+
[changelog-link]: https://github.com/cpp-linter/cpp-linter-rs/blob/main/cpp-linter/CHANGELOG.md

0 commit comments

Comments
 (0)