"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "crates/printer/src/lib.rs" between
ripgrep-12.1.1.tar.gz and ripgrep-13.0.0.tar.gz

About: ripgrep is a command line search tool ("rg") that tries to combine the usability of "ag" (an "ack" clone) with the raw speed of GNU "grep" (written in "Rust").

lib.rs  (ripgrep-12.1.1):lib.rs  (ripgrep-13.0.0)
skipping to change at line 16 skipping to change at line 16
# Brief overview # Brief overview
The [`Standard`](struct.Standard.html) printer shows results in a human The [`Standard`](struct.Standard.html) printer shows results in a human
readable format, and is modeled after the formats used by standard grep-like readable format, and is modeled after the formats used by standard grep-like
tools. Features include, but are not limited to, cross platform terminal tools. Features include, but are not limited to, cross platform terminal
coloring, search & replace, multi-line result handling and reporting summary coloring, search & replace, multi-line result handling and reporting summary
statistics. statistics.
The [`JSON`](struct.JSON.html) printer shows results in a machine readable The [`JSON`](struct.JSON.html) printer shows results in a machine readable
format. To facilitate a stream of search results, the format uses format. To facilitate a stream of search results, the format uses
[JSON Lines](http://jsonlines.org/) [JSON Lines](https://jsonlines.org/)
by emitting a series of messages as search results are found. by emitting a series of messages as search results are found.
The [`Summary`](struct.Summary.html) printer shows *aggregate* results for a The [`Summary`](struct.Summary.html) printer shows *aggregate* results for a
single search in a human readable format, and is modeled after similar formats single search in a human readable format, and is modeled after similar formats
found in standard grep-like tools. This printer is useful for showing the total found in standard grep-like tools. This printer is useful for showing the total
number of matches and/or printing file paths that either contain or don't number of matches and/or printing file paths that either contain or don't
contain matches. contain matches.
# Example # Example
This example shows how to create a "standard" printer and execute a search. This example shows how to create a "standard" printer and execute a search.
``` ```
extern crate grep_regex;
extern crate grep_printer;
extern crate grep_searcher;
use std::error::Error; use std::error::Error;
use grep_regex::RegexMatcher; use grep_regex::RegexMatcher;
use grep_printer::Standard; use grep_printer::Standard;
use grep_searcher::Searcher; use grep_searcher::Searcher;
const SHERLOCK: &'static [u8] = b"\ const SHERLOCK: &'static [u8] = b"\
For the Doctor Watsons of this world, as opposed to the Sherlock For the Doctor Watsons of this world, as opposed to the Sherlock
Holmeses, success in the province of detective work must always Holmeses, success in the province of detective work must always
be, to a very large extent, the result of luck. Sherlock Holmes be, to a very large extent, the result of luck. Sherlock Holmes
skipping to change at line 71 skipping to change at line 67
3:be, to a very large extent, the result of luck. Sherlock Holmes 3:be, to a very large extent, the result of luck. Sherlock Holmes
"; ";
assert_eq!(output, expected); assert_eq!(output, expected);
Ok(()) Ok(())
} }
``` ```
*/ */
#![deny(missing_docs)] #![deny(missing_docs)]
#[cfg(feature = "serde1")] pub use crate::color::{
extern crate base64; default_color_specs, ColorError, ColorSpecs, UserColorSpec,
extern crate bstr; };
extern crate grep_matcher; #[cfg(feature = "serde1")]
#[cfg(test)] pub use crate::json::{JSONBuilder, JSONSink, JSON};
extern crate grep_regex; pub use crate::standard::{Standard, StandardBuilder, StandardSink};
extern crate grep_searcher; pub use crate::stats::Stats;
#[cfg(feature = "serde1")] pub use crate::summary::{Summary, SummaryBuilder, SummaryKind, SummarySink};
extern crate serde; pub use crate::util::PrinterPath;
#[cfg(feature = "serde1")]
#[macro_use] // The maximum number of bytes to execute a search to account for look-ahead.
extern crate serde_derive; //
#[cfg(feature = "serde1")] // This is an unfortunate kludge since PCRE2 doesn't provide a way to search
extern crate serde_json; // a substring of some input while accounting for look-ahead. In theory, we
extern crate termcolor; // could refactor the various 'grep' interfaces to account for it, but it would
// be a large change. So for now, we just let PCRE2 go looking a bit for a
pub use color::{default_color_specs, ColorError, ColorSpecs, UserColorSpec}; // match without searching the entire rest of the contents.
#[cfg(feature = "serde1")] //
pub use json::{JSONBuilder, JSONSink, JSON}; // Note that this kludge is only active in multi-line mode.
pub use standard::{Standard, StandardBuilder, StandardSink}; const MAX_LOOK_AHEAD: usize = 128;
pub use stats::Stats;
pub use summary::{Summary, SummaryBuilder, SummaryKind, SummarySink};
pub use util::PrinterPath;
#[macro_use] #[macro_use]
mod macros; mod macros;
mod color; mod color;
mod counter; mod counter;
#[cfg(feature = "serde1")] #[cfg(feature = "serde1")]
mod json; mod json;
#[cfg(feature = "serde1")] #[cfg(feature = "serde1")]
mod jsont; mod jsont;
 End of changes. 3 change blocks. 
28 lines changed or deleted 21 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)