Use styles when encoding

This commit is contained in:
Nathan Fisher 2025-01-26 18:58:54 -05:00
parent 02bd59d84c
commit c56048ecd7
2 changed files with 7 additions and 4 deletions

4
Cargo.lock generated
View file

@ -1,11 +1,11 @@
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
version = 3
version = 4
[[package]]
name = "b2"
version = "0.1.0"
source = "git+https://git.hitchhiker-linux.org/jeang3nie/b2_rs.git#3ab66346610d681cf764f24bbdd8d5416d7ef1b6"
source = "git+https://git.hitchhiker-linux.org/jeang3nie/b2_rs.git#684d25e0198cda683603ddcc87889dae119be0a9"
[[package]]
name = "base2"

View file

@ -61,8 +61,11 @@ fn main() -> Result<(), Box<dyn Error>> {
let wrap: usize = if let Some(w) = matches.opt_str("w") {
w.parse()?
} else {
76
8
};
let style: Option<Style> = matches.opt_str("s")
.map(|x| x.parse().ok())
.flatten();
let mut infiles = matches
.free
@ -108,7 +111,7 @@ fn main() -> Result<(), Box<dyn Error>> {
match op {
Operation::Decode => {}
Operation::Encode => {
let encoder = Encoder::new(reader, writer, None, Some(wrap));
let encoder = Encoder::new(reader, writer, style, Some(wrap));
encoder.encode()?;
}
}