cyto_cli/map/runtime.rs
1use clap::Parser;
2
3#[derive(Debug, Clone, Copy, Parser)]
4#[clap(next_help_heading = "Runtime Options")]
5pub struct RuntimeOptions {
6 /// Number of threads to use [0: auto]
7 #[clap(short = 'T', long, default_value_t = 0)]
8 pub num_threads: usize,
9
10 /// Output runtime information
11 #[clap(short, long)]
12 pub verbose: bool,
13}
14impl RuntimeOptions {
15 pub fn num_threads(&self) -> usize {
16 if self.num_threads == 0 {
17 num_cpus::get()
18 } else {
19 self.num_threads
20 }
21 }
22}