mirror of
https://github.com/sharkdp/bat.git
synced 2025-08-09 07:45:09 +02:00
Moved user_provided_filename to be contained within OrdinaryFile struct
This commit is contained in:
committed by
David Peter
parent
a3f8140fbe
commit
04fa84aea7
@ -1,7 +1,7 @@
|
||||
/// A very simple colorized `cat` clone, using `bat` as a library.
|
||||
/// See `src/bin/bat` for the full `bat` application.
|
||||
use bat::{
|
||||
config::{Config, InputFile, StyleComponent, StyleComponents},
|
||||
config::{Config, InputFile, OrdinaryFile, StyleComponent, StyleComponents},
|
||||
Controller, HighlightingAssets,
|
||||
};
|
||||
use console::Term;
|
||||
@ -24,7 +24,10 @@ fn main() {
|
||||
StyleComponent::Grid,
|
||||
StyleComponent::Numbers,
|
||||
]),
|
||||
files: files.iter().map(|file| InputFile::Ordinary(file)).collect(),
|
||||
files: files
|
||||
.iter()
|
||||
.map(|file| InputFile::Ordinary(OrdinaryFile::new(file, None)))
|
||||
.collect(),
|
||||
..Default::default()
|
||||
};
|
||||
let assets = HighlightingAssets::from_binary();
|
||||
|
@ -1,6 +1,6 @@
|
||||
/// A simple program that prints its own source code using the bat library
|
||||
use bat::{
|
||||
config::{Config, InputFile},
|
||||
config::{Config, InputFile, OrdinaryFile},
|
||||
Controller, HighlightingAssets,
|
||||
};
|
||||
use std::ffi::OsStr;
|
||||
@ -9,7 +9,10 @@ fn main() {
|
||||
let path_to_this_file = OsStr::new(file!());
|
||||
|
||||
let config = Config {
|
||||
files: vec![InputFile::Ordinary(path_to_this_file)],
|
||||
files: vec![InputFile::Ordinary(OrdinaryFile::new(
|
||||
path_to_this_file,
|
||||
None,
|
||||
))],
|
||||
colored_output: true,
|
||||
true_color: true,
|
||||
..Default::default()
|
||||
|
Reference in New Issue
Block a user