#cargo #cargo-subcommand #single-line #output #shrink #color

app cargo-single-line

A cargo plugin to shrink cargo's output

6 releases

new 0.1.6 Apr 21, 2024
0.1.4 Sep 29, 2021

#117 in Cargo plugins

Download history 5/week @ 2024-02-20 3/week @ 2024-02-27 6/week @ 2024-03-12 1/week @ 2024-03-26 12/week @ 2024-04-02 110/week @ 2024-04-16

123 downloads per month

Apache-2.0/MIT

10KB
117 lines

cargo single-line

Crates.io

A simple cargo plugin that shrinks the visible cargo output to a single line (okay, in the best case scenario).

In principle, the plugin works by intercepting the cargo's stderr and replacing the newline characters in it with a carriage return symbol.

When cargo prints a line which is not Compiling/Checking/etc., it probably means an error/warning, so such a line is forwarded "as is" to the user so the possibly useful output is not overwritten by the further data.

The tool can be used with any cargo subcommand, just insert single-line between cargo and your command, like the following:

  • cargo buildcargo single-line build,
  • cargo runcargo single-line run,
  • cargo clippycargo single-line clippy,
  • ... and so forth.

By default, when running from a terminal, the plugin enforces a colorful output by running cargo with a --color=always argument. To override the behavior, add an explicit --color MODE flag to your command line.

asciicast

Installation

To install the plugin from crates.io:

$ cargo install cargo-single-line

To install the plugin from a checkout git repository:

$ cargo install --path .

Dependencies

~2.1–3.5MB
~55K SLoC