Skip to content

Commit

Permalink
added show-tabs (-T) feature
Browse files Browse the repository at this point in the history
  • Loading branch information
Skosulor committed Jun 6, 2020
1 parent 2f71893 commit 4f2c4d0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ TODO
* [ ] -e, equivalent to -vE
* [X] -E, --show-ends
* [X] -n, --number
* [ ] -s, --squeeze blank
* [X] -s, --squeeze blank
* [ ] -t equivalent to -vT
* [ ] -T, --show-tabs
* [X] -T, --show-tabs
* [X] -u (ignored)
* [ ] -v, --show-nonprinting
* [ ] --help display this help and exit
Expand Down
10 changes: 5 additions & 5 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,12 @@ struct Output {
opt: Options,
}

// fn display_help() {}
// fn version() {}

impl Output {
fn format_output(&mut self) {
let f_vec: Vec<&dyn Fn(&mut Output)> = vec![
&Output::remove_duplicate_blank,
&Output::number_lines,
&Output::show_ends,
&Output::remove_duplicate_blank,
&Output::show_tabs,
&Output::show_nonprinting,
];
Expand Down Expand Up @@ -136,9 +133,12 @@ impl Output {
}
fn show_tabs(&mut self) {
if self.opt.show_tabs || self.opt.nonPrint_and_showTabs || self.opt.A {
()
for line in self.out.iter_mut() {
*line = line.replace("\t", "^I").clone();
}
}
}

//
// display charactars as ^ which are not supported by the terminal
fn show_nonprinting(&mut self) {
Expand Down

0 comments on commit 4f2c4d0

Please sign in to comment.