Skip to content

Commit d939082

Browse files
committed
Add a --align flag to the "compress" subcommand
1 parent 4b63439 commit d939082

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

cli/src/args.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use zeekstd::{CompressionLevel, SeekTable, seek_table};
88
// 128 MiB
99
const MMAP_THRESHOLD: u64 = 0x0010_0000;
1010

11-
#[derive(Debug, Clone)]
11+
#[derive(Debug, Copy, Clone)]
1212
pub struct ByteValue(u32);
1313

1414
impl ByteValue {
@@ -178,6 +178,9 @@ pub struct CompressArgs {
178178
#[arg(long, default_value = "uncompressed")]
179179
pub frame_size_policy: FrameSizePolicy,
180180

181+
#[arg(long)]
182+
pub align: Option<ByteValue>,
183+
181184
/// Provide a reference point for Zstandard's diff engine.
182185
#[arg(long)]
183186
pub patch_from: Option<PathBuf>,

cli/src/compress.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ impl<W> Compressor<'_, W> {
3535

3636
let encoder = EncodeOptions::with_cctx(cctx)
3737
.frame_size_policy(args.to_frame_size_policy())
38+
.align(args.align.map(|x| x.as_u32()))
3839
.checksum_flag(!args.no_checksum)
3940
.compression_level(args.compression_level)
4041
.into_encoder(writer)

0 commit comments

Comments
 (0)