mirror of
https://github.com/exoticorn/upkr.git
synced 2026-01-20 11:36:42 +01:00
add --version flag to output upkr version
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
VERSION=0.2.0
|
VERSION := $(shell cargo run --release -- --version)
|
||||||
|
|
||||||
all: clean upkr-linux-$(VERSION).tgz upkr-windows-$(VERSION).zip
|
all: clean upkr-linux-$(VERSION).tgz upkr-windows-$(VERSION).zip
|
||||||
|
|
||||||
|
|||||||
@@ -61,6 +61,10 @@ fn main() -> Result<()> {
|
|||||||
Short('l') | Long("level") => level = parser.value()?.parse()?,
|
Short('l') | Long("level") => level = parser.value()?.parse()?,
|
||||||
Short(n) if n.is_ascii_digit() => level = n as u8 - b'0',
|
Short(n) if n.is_ascii_digit() => level = n as u8 - b'0',
|
||||||
Short('h') | Long("help") => print_help(0),
|
Short('h') | Long("help") => print_help(0),
|
||||||
|
Long("version") => {
|
||||||
|
println!("{}", env!("CARGO_PKG_VERSION"));
|
||||||
|
process::exit(0);
|
||||||
|
}
|
||||||
Long("max-unpacked-size") => max_unpacked_size = parser.value()?.parse()?,
|
Long("max-unpacked-size") => max_unpacked_size = parser.value()?.parse()?,
|
||||||
Value(val) if infile.is_none() => infile = Some(val.try_into()?),
|
Value(val) if infile.is_none() => infile = Some(val.try_into()?),
|
||||||
Value(val) if outfile.is_none() => outfile = Some(val.try_into()?),
|
Value(val) if outfile.is_none() => outfile = Some(val.try_into()?),
|
||||||
@@ -155,6 +159,8 @@ fn print_help(exit_code: i32) -> ! {
|
|||||||
eprintln!(" -u, --unpack unpack infile");
|
eprintln!(" -u, --unpack unpack infile");
|
||||||
eprintln!(" --margin calculate margin for overlapped unpacking of a packed file");
|
eprintln!(" --margin calculate margin for overlapped unpacking of a packed file");
|
||||||
eprintln!();
|
eprintln!();
|
||||||
|
eprintln!("Version: {}", env!("CARGO_PKG_VERSION"));
|
||||||
|
eprintln!();
|
||||||
eprintln!("Config presets for specific unpackers:");
|
eprintln!("Config presets for specific unpackers:");
|
||||||
eprintln!(" --z80 --big-endian-bitstream --invert-bit-encoding --simplified-prob-update -9");
|
eprintln!(" --z80 --big-endian-bitstream --invert-bit-encoding --simplified-prob-update -9");
|
||||||
eprintln!(
|
eprintln!(
|
||||||
|
|||||||
Reference in New Issue
Block a user