mirror of
https://github.com/alexpasmantier/television.git
synced 2025-06-06 19:45:23 +00:00
fix: quote file names that contain spaces when printing them to stdout (#51)
This commit is contained in:
parent
d3564f2aca
commit
21cdaaee42
@ -105,6 +105,10 @@ impl Entry {
|
|||||||
|
|
||||||
pub fn stdout_repr(&self) -> String {
|
pub fn stdout_repr(&self) -> String {
|
||||||
let mut repr = self.name.clone();
|
let mut repr = self.name.clone();
|
||||||
|
if repr.contains(|c| char::is_ascii_whitespace(&c)) {
|
||||||
|
repr.insert(0, '\'');
|
||||||
|
repr.push('\'');
|
||||||
|
}
|
||||||
if let Some(line_number) = self.line_number {
|
if let Some(line_number) = self.line_number {
|
||||||
repr.push_str(&format!(":{line_number}"));
|
repr.push_str(&format!(":{line_number}"));
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user