Skip to content

Commit

Permalink
Moved cat "header" to stderr for easier piping
Browse files Browse the repository at this point in the history
  • Loading branch information
juan-riveros authored Dec 7, 2021
1 parent bdc6ad2 commit a11d06a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/commands/cat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,9 @@ impl<'a> PQRSCommand for CatCommand<'a> {
let file = open_file(file_name)?;
let info_string = format!("File: {}", file_name);
let length = info_string.len();
println!("\n{}", "#".repeat(length));
println!("{}", info_string);
println!("{}\n", "#".repeat(length));
eprintln!("\n{}", "#".repeat(length));
eprintln!("{}", info_string);
eprintln!("{}\n", "#".repeat(length));
print_rows(file, None, self.format)?;
}

Expand Down

0 comments on commit a11d06a

Please sign in to comment.