feat: print usage when running patch without args (#124)
This commit is contained in:
@@ -11,6 +11,23 @@ use std::time::Instant;
|
||||
|
||||
fn main() {
|
||||
let mut args = std::env::args();
|
||||
if args.len() < 4 {
|
||||
eprintln!(
|
||||
"Usage: {} <base> <new> <output>",
|
||||
std::path::Path::new(&args.next().unwrap())
|
||||
.file_name()
|
||||
.unwrap()
|
||||
.to_str()
|
||||
.unwrap()
|
||||
);
|
||||
eprintln!(" base: Path to the base file");
|
||||
eprintln!(" new: Path to the new file");
|
||||
eprintln!(" output: Path to the output patch file");
|
||||
eprintln!("");
|
||||
eprintln!(" This is an internal tool for creating binary diffs.");
|
||||
std::process::exit(1);
|
||||
}
|
||||
|
||||
args.next(); // skip program name
|
||||
let older = args.next().expect("path to base file");
|
||||
let newer = args.next().expect("path to new file");
|
||||
|
||||
Reference in New Issue
Block a user