use clap::Args;
/// The capacity of the channels connecting the pipeline tasks, shared by the subcommands so the
/// flag cannot drift between them.
#[derive(Args, Debug, Clone, Copy)]
#[command(next_help_heading = "Advanced")]
pub struct BufferArg {
/// The capacity of the in-memory buffer channels connecting the reader, aligner and writer tasks, in messages.
/// Larger values let the tasks run further ahead of each other at the cost of memory.
#[arg(
long = "buffer",
value_name = "NUM",
default_value_t = Self::DEFAULT,
help_heading = "Advanced"
)]
pub buffer_size: usize,
}
impl BufferArg {
const DEFAULT: usize = 8192;
}
impl Default for BufferArg {
fn default() -> Self {
Self {
buffer_size: Self::DEFAULT,
}
}
}