1use super::IbuInput;
2
3#[derive(clap::Parser, Debug)]
4pub struct ArgsSort {
5 #[clap(flatten)]
6 pub input: IbuInput,
7
8 #[clap(short, long, required_unless_present("pipe"))]
12 pub output: Option<String>,
13
14 #[clap(short, long, default_value = "5GiB")]
16 pub memory_limit: String,
17
18 #[clap(short, long)]
22 pub in_memory: bool,
23
24 #[clap(short, long, conflicts_with("output"))]
28 pub pipe: bool,
29
30 #[clap(short = 't', long, default_value = "1")]
31 pub num_threads: usize,
32}
33impl ArgsSort {
34 pub fn from_wf_path(
35 path: &str,
36 output: &str,
37 in_memory: bool,
38 memory_limit: String,
39 num_threads: usize,
40 ) -> Self {
41 let input = IbuInput::from_path(path);
42 Self {
43 input,
44 num_threads,
45 output: Some(output.to_string()),
46 pipe: false,
47 in_memory,
48 memory_limit,
49 }
50 }
51}