Skip to content
This repository has been archived by the owner on Jul 11, 2019. It is now read-only.

Commit

Permalink
Write standard input message to standard error
Browse files Browse the repository at this point in the history
Resolves Issue #43
  • Loading branch information
mmstick committed Jan 22, 2017
1 parent e09c3a6 commit 147e8b3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/arguments/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,11 @@ fn quote_inputs(input: &str) -> String {
fn write_stdin_to_disk(max_args: usize, mut unprocessed_path: PathBuf, inputs_are_commands: bool,
quote_enabled: bool) -> Result<usize, ParseErr>
{
println!("parallel: reading inputs from standard input");
// Write a message to standard error that inputs are being read from standard input
let stderr = io::stderr();
let mut stderr = stderr.lock();
let _ = stderr.write(b"parallel: reading inputs from standard input\n");

unprocessed_path.push("unprocessed");
let disk_buffer = fs::OpenOptions::new().truncate(true).write(true).create(true).open(&unprocessed_path)
.map_err(|why| ParseErr::File(FileErr::Open(unprocessed_path.clone(), why)))?;
Expand Down
1 change: 1 addition & 0 deletions src/tokenizer/functions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ pub fn dirname(input: &str) -> &str {
#[cfg(test)]
mod tests {
use super::*;

#[test]
fn path_remove_ext_simple() {
assert_eq!(remove_extension("foo.txt"), "foo");
Expand Down

0 comments on commit 147e8b3

Please sign in to comment.