]>
git.proxmox.com Git - rustc.git/blob - vendor/unified-diff/src/main.rs
1 // Sample program. Do not use.
4 use std
::io
::{self, Write}
;
7 let mut o
= env
::args_os();
9 let exe
= match o
.next() {
12 eprintln
!("Usage: [exe] [from] [to]");
16 let from
= match o
.next() {
19 eprintln
!("Usage: {} [from] [to]", exe
.to_string_lossy());
23 let to
= match o
.next() {
26 eprintln
!("Usage: {} [from] [to]", exe
.to_string_lossy());
31 let from_content
= match fs
::read(&from
) {
32 Ok(from_content
) => from_content
,
34 eprintln
!("Failed to read from-file: {}", e
);
38 let to_content
= match fs
::read(&to
) {
39 Ok(to_content
) => to_content
,
41 eprintln
!("Failed to read to-file: {}", e
);
47 .write_all(&unified_diff
::diff(
49 &from
.to_string_lossy(),
51 &to
.to_string_lossy(),