@@ -16,7 +16,7 @@ use console::Term;
1616use bat::{
1717 config::{
1818 Config, HighlightedLineRanges, InputFile, LineRange, LineRanges, MappingTarget,
19− OrdinaryFile, OutputWrap, PagingMode, StyleComponent, StyleComponents, SyntaxMapping,
19+ OrdinaryFile, PagingMode, StyleComponent, StyleComponents, SyntaxMapping, WrappingMode,
2020 },
2121 errors::*,
2222 HighlightingAssets,
@@ -143,22 +143,22 @@ impl App {
143143 }
144144 }),
145145 show_nonprintable: self.matches.is_present("show-all"),
146− output_wrap: if self.interactive_output || maybe_term_width.is_some() {
146+ wrapping_mode: if self.interactive_output || maybe_term_width.is_some() {
147147 match self.matches.value_of("wrap") {
148− Some("character") => OutputWrap::Character,
149− Some("never") => OutputWrap::None,
148+ Some("character") => WrappingMode::Character,
149+ Some("never") => WrappingMode::NoWrapping,
150150 Some("auto") | _ => {
151151 if style_components.plain() {
152− OutputWrap::None
152+ WrappingMode::NoWrapping
153153 } else {
154− OutputWrap::Character
154+ WrappingMode::Character
155155 }
156156 }
157157 }
158158 } else {
159159 // We don't have the tty width when piping to another program.
160160 // There's no point in wrapping when this is the case.
161− OutputWrap::None
161+ WrappingMode::NoWrapping
162162 },
163163 colored_output: match self.matches.value_of("color") {
164164 Some("always") => true,
@@ -247,7 +247,9 @@ impl App {
247247 let files: Option<Vec<&OsStr>> = self.matches.values_of_os("FILE").map(|vs| vs.collect());
248248
249249 if files.is_none() {
250− return Ok(vec![InputFile::StdIn(filenames_or_none.nth(0).unwrap())]);
250+ return Ok(vec![InputFile::StdIn(
251+ filenames_or_none.nth(0).unwrap().map(|f| f.to_owned()),
252+ )]);
251253 }
252254 let files_or_none: Box<dyn Iterator<Item = _>> = match files {
253255 Some(ref files) => Box::new(files.into_iter().map(|name| Some(*name))),
@@ -258,7 +260,7 @@ impl App {
258260 for (input, name) in files_or_none.zip(filenames_or_none) {
259261 if let Some(input) = input {
260262 if input.to_str().unwrap_or_default() == "-" {
261− file_input.push(InputFile::StdIn(name));
263+ file_input.push(InputFile::StdIn(name.map(|n| n.to_owned())));
262264 } else {
263265 let mut ofile = OrdinaryFile::from_path(input);
264266 if let Some(path) = name {