1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
use clap::IntoApp;
use clap::{AppSettings, Parser, Subcommand};
#[derive(Parser, Debug)]
#[clap(
author,
version,
about,
propagate_version = true,
subcommand_required = true,
infer_subcommands = true,
arg_required_else_help = true,
help_expected = true
)]
#[clap(global_setting(AppSettings::DeriveDisplayOrder))]
pub struct Cli {
#[clap(short, long, default_value_t = 8)]
pub threads: usize,
#[clap(short, long, parse(from_occurrences), help_heading = "DEBUG")]
pub verbose: usize,
#[clap(subcommand)]
pub command: Option<Commands>,
}
#[derive(Subcommand, Debug)]
pub enum Commands {
#[clap(visible_aliases = &["ex", "e"])]
Extract {
#[clap(default_value = "-")]
bam: String,
#[clap(short, long)]
reference: bool,
#[clap(short, long)]
m6a: Option<String>,
#[clap(short, long)]
cpg: Option<String>,
#[clap(short, long)]
msp: Option<String>,
#[clap(short, long)]
nuc: Option<String>,
},
}
pub fn make_cli_parse() -> Cli {
Cli::parse()
}
pub fn make_cli_app() -> clap::Command<'static> {
Cli::command()
}