Skip to content

Commit 0b92617

Browse files
committed
Initial commit
0 parents  commit 0b92617

File tree

5 files changed

+607
-0
lines changed

5 files changed

+607
-0
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/target

Cargo.lock

+240
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
[package]
2+
name = "cargo-cut-diagnostics"
3+
version = "0.1.0"
4+
edition = "2021"
5+
description = "Cargo subcommand to display only the first page of diagnostics"
6+
repository = "https://github.com/SabrinaJewson/cargo-cut-diagnostics"
7+
license = "MIT"
8+
9+
[dependencies]
10+
anyhow = "1.0.51"
11+
cargo_metadata = "0.14.1"
12+
serde_json = "1.0.73"
13+
terminal_size = "0.1.17"
14+
textwrap = "0.14.2"

README.md

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# cargo-cut-diagnostics
2+
3+
A cargo subcommand that displays only the first page of diagnostics.
4+
5+
## Installation
6+
7+
```
8+
cargo install --git https://github.com/SabrinaJewson/cargo-cut-diagnostics
9+
```
10+
11+
## Usage
12+
13+
```
14+
USAGE:
15+
cargo cut-diagnostics [OPTIONS] [SUBCOMMAND] [args]...
16+
17+
OPTIONS:
18+
--max-height height
19+
Set the maximum height the diagnostics will reach before being cut.
20+
Defaults to the height of the terminal minus 4. Mutually exclusive with
21+
--lines-around.
22+
--lines-around lines
23+
Set the number of lines around the diagnostics. The maximum height of
24+
the diagnostics will be the terminal height minus this value. Defaults
25+
to 4. Mutually exclusive with --max-height.
26+
--help, -h
27+
Display this help message and exit.
28+
--
29+
Stop processing command line arguments and treat the next argument as a
30+
subcommand.
31+
32+
EXAMPLES:
33+
Common usage with `cargo check`:
34+
cargo cut-diagnostics check
35+
Run clippy on every target in the package:
36+
cargo cut-diagnostics clippy --all-targets
37+
```
38+
39+
## See also
40+
41+
This project was inspired by [cargo-firstpage](https://github.com/cecton/cargo-firstpage), however:
42+
- It features more command line options.
43+
- It doesn't cause the native Cargo progress bar to disappear.
44+
- I found it to handle Cargo output more reliably in general.

0 commit comments

Comments
 (0)