diff --git a/Cargo.toml b/Cargo.toml index 46dc4cb..1a8c39d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "upkr" -version = "0.2.1" +version = "0.2.2" edition = "2021" [profile.release] diff --git a/README.md b/README.md index 54af2e6..2232d9c 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,12 @@ c_unpacker and asm_unpackers unpack the default upkr compressed format. The z80_ is based on some variations to the compressed format. (Use `upkr --z80` to select those variations.) The 16 bit dos unpacker also uses some variations. (`upkr --x86`) +### More unpackers outside this repository + +* [Atari Lynx](https://github.com/42Bastian/new_bll/blob/master/demos/depacker/unupkr.asm) +* [Atari Jaguar](https://github.com/42Bastian/new_bjl/blob/main/exp/depacker/unupkr.js) +* [8080, R800](https://github.com/ivagorRetrocomp/DeUpkr) + ## Usage ``` @@ -32,10 +38,13 @@ The 16 bit dos unpacker also uses some variations. (`upkr --x86`) -l, --level N compression level 0-9 -0, ..., -9 short form for setting compression level - -u, --unpack unpack infile + -d, --decompress decompress infile --heatmap calculate heatmap from compressed file --margin calculate margin for overlapped unpacking of a packed file +When no infile is given, or the infile is '-', read from stdin. +When no outfile is given and reading from stdin, or when outfile is '-', write to stdout. + Config presets for specific unpackers: --z80 --big-endian-bitstream --invert-bit-encoding --simplified-prob-update -9 --x86 --bitstream --invert-is-match-bit --invert-continue-value-bit --invert-new-offset-bit diff --git a/src/main.rs b/src/main.rs index cfeeaaf..4c0e5ac 100644 --- a/src/main.rs +++ b/src/main.rs @@ -59,7 +59,7 @@ fn main() -> Result<()> { level = 9; } - Short('u') | Long("unpack") => unpack = true, + Short('u') | Long("unpack") | Short('d') | Long("decompress") => unpack = true, Long("margin") => calculate_margin = true, Long("heatmap") => create_heatmap = true, #[cfg(feature = "crossterm")] @@ -94,7 +94,7 @@ fn main() -> Result<()> { #[cfg(feature = "terminal")] let mut packed_data = { - let mut pb = pbr::ProgressBar::new(data.len() as u64); + let mut pb = pbr::ProgressBar::on(std::io::stderr(), data.len() as u64); pb.set_units(pbr::Units::Bytes); let packed_data = upkr::pack( &data, @@ -105,6 +105,7 @@ fn main() -> Result<()> { }), ); pb.finish(); + eprintln!(); packed_data }; #[cfg(not(feature = "terminal"))] @@ -246,7 +247,7 @@ fn print_help(exit_code: i32) -> ! { eprintln!(); eprintln!(" -l, --level N compression level 0-9"); eprintln!(" -0, ..., -9 short form for setting compression level"); - eprintln!(" -u, --unpack unpack infile"); + eprintln!(" -d, --decompress decompress infile"); eprintln!(" --heatmap calculate heatmap from compressed file"); eprintln!(" --margin calculate margin for overlapped unpacking of a packed file"); eprintln!();