mirror of
https://github.com/exoticorn/upkr.git
synced 2026-01-20 11:36:42 +01:00
update readme, change --unpack to --decompress, put progress bar on stderr
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "upkr"
|
||||
version = "0.2.1"
|
||||
version = "0.2.2"
|
||||
edition = "2021"
|
||||
|
||||
[profile.release]
|
||||
|
||||
11
README.md
11
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
|
||||
|
||||
@@ -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!();
|
||||
|
||||
Reference in New Issue
Block a user