diff options
author | Justin Worthe <justin@worthe-it.co.za> | 2017-08-20 21:45:52 +0200 |
---|---|---|
committer | Justin Worthe <justin@worthe-it.co.za> | 2017-08-20 21:45:52 +0200 |
commit | f3c7ede6af566839918cb884cde5572049962f7f (patch) | |
tree | d2297bb55de5e6df75b2f25503518dc169af06f4 /src/bin/pre-commit.rs | |
parent | 6503d1d27ddfb23385e037ac9dc8de3cb12205e5 (diff) |
Added logging of stdin
Stdin is used to provide additional info on some hooks, like on
pre-push.
Diffstat (limited to 'src/bin/pre-commit.rs')
-rw-r--r-- | src/bin/pre-commit.rs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/bin/pre-commit.rs b/src/bin/pre-commit.rs new file mode 100644 index 0000000..7b52443 --- /dev/null +++ b/src/bin/pre-commit.rs @@ -0,0 +1,14 @@ +use std::env; +use std::io::{stdin, BufRead}; + +fn main() { + let args: Vec<_> = env::args().skip(1).collect(); + println!("pre-commit called with {:?}", args); + + println!("BEGIN STDIN for pre-commit"); + let stdin = stdin(); + for line in stdin.lock().lines() { + println!("{:?}", line); + } + println!("END STDIN"); +} |