Length is optional

This commit is contained in:
jpk 2022-12-15 12:54:11 +01:00
parent 66bebb3693
commit 91c6b83c34
1 changed files with 7 additions and 1 deletions

View File

@ -1,5 +1,6 @@
use std::fs::File;
use std::io;
use std::usize::MAX;
mod colormap;
@ -35,7 +36,12 @@ fn main() {
};
if !args.revert {
hexdump(reader, args.length.unwrap());
let length = if args.length.is_some() {
args.length.unwrap()
} else {
MAX
};
hexdump(reader, length);
} else {
let writer: Box<dyn io::Write> = Box::new(io::stdout());
bindump(reader, writer);