mirror of
https://github.com/sharkdp/bat.git
synced 2025-01-31 02:01:05 +00:00
rename run => print
This commit is contained in:
parent
eee35e54e9
commit
f034be71e7
@ -12,6 +12,6 @@ fn main() {
|
||||
StyleComponent::Numbers,
|
||||
]))
|
||||
.input_files(std::env::args_os().skip(1))
|
||||
.run()
|
||||
.print()
|
||||
.expect("no errors");
|
||||
}
|
||||
|
@ -7,6 +7,6 @@ fn main() {
|
||||
|
||||
PrettyPrinter::new()
|
||||
.input_file(path_to_this_file)
|
||||
.run()
|
||||
.print()
|
||||
.expect("no errors");
|
||||
}
|
||||
|
@ -1,10 +1,11 @@
|
||||
//! `bat` is a library to print syntax highlighted content.
|
||||
//!
|
||||
//! The main struct is `PrettyPrinter` which can be used to configure and
|
||||
//! run the syntax highlighting.
|
||||
//! The main struct of this crate is `PrettyPrinter` which can be used to
|
||||
//! configure and run the syntax highlighting.
|
||||
//!
|
||||
//! If you need more control, you can also use the structs in the submodules
|
||||
//! (start with `controller::Controller`), but note that the API of these
|
||||
//! internal modules much more likely to change.
|
||||
//! internal modules is much more likely to change.
|
||||
//!
|
||||
//! "Hello world" example:
|
||||
//! ```
|
||||
|
@ -160,10 +160,10 @@ impl<'a> PrettyPrinter<'a> {
|
||||
self
|
||||
}
|
||||
|
||||
/// Pretty-print all specified inputs. This method will drain all stored inputs.
|
||||
/// If you want to call 'run' multiple times, you have to call the appropriate
|
||||
/// Pretty-print all specified inputs. This method will "use" all stored inputs.
|
||||
/// If you want to call 'print' multiple times, you have to call the appropriate
|
||||
/// input_* methods again.
|
||||
pub fn run(&mut self) -> Result<bool> {
|
||||
pub fn print(&mut self) -> Result<bool> {
|
||||
self.config.highlighted_lines =
|
||||
HighlightedLineRanges(LineRanges::from(self.highlighted_lines.clone()));
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user