Skip to content

Commit

Permalink
Trim line endings to save space
Browse files Browse the repository at this point in the history
  • Loading branch information
Kyza committed Jul 26, 2021
1 parent 037e24b commit 85752cd
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "rusefs"
version = "0.2.3"
version = "0.2.4"
edition = "2018"

[dependencies]
Expand Down
14 changes: 11 additions & 3 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use termcolor::{Color, ColorChoice, ColorSpec, StandardStream, WriteColor};

fn main() {
let matches = clap_app!(rusefs =>
(version: "0.2.3")
(version: "0.2.4")
(author: "Kyza")
(about: "Search your filesystem quickly using regex.")
(@arg FOLDER: -f --folder +multiple +takes_value "The folder to search. Defaults to the current directory.")
Expand Down Expand Up @@ -205,9 +205,17 @@ fn search_file_contents(contentses: &[Regex], max_size: &u64, file_path: &str) {
ending_string = ending_string_vec[0];
}

write_color(&mut stdout, Color::White, format!("{}", starting_string));
write_color(
&mut stdout,
Color::White,
format!("{}", starting_string.trim_start()),
);
write_color(&mut stdout, Color::Green, format!("{}", capture.as_str()));
writeln_color(&mut stdout, Color::White, format!("{}", ending_string));
writeln_color(
&mut stdout,
Color::White,
format!("{}", ending_string.trim_end()),
);
}
if count == 1 {
writeln_color(&mut stdout, Color::Yellow, format!("{} Result", count));
Expand Down

0 comments on commit 85752cd

Please sign in to comment.