#diff #format #color #terminals #fmt #object #mask

nightly diff_fmt

A simple diff format for color terminals

1 unstable release

0.1.0 Oct 25, 2019

#10 in #mask

26 downloads per month

Apache-2.0

19KB
482 lines

A simple diff and mask format for color terminals

Usage:

use fmt_diff::*;

println!("{:08b}", diff(&0x0F, &0x07));

The only two public functions, diff and mask take two functions, and return a format object. The format object takes the parameters supplied by the format macro, and formats the provided objects.

The diff format will format every character that is the same with a green color, and different characters with a red color. The diff only prints the first object.

The mask format will format every character of the first, colored green if the second is an (ascii) zero, or space, or red otherwise.

Dependencies

~165KB