1#[derive(clap::Parser, std::fmt::Debug)]
10#[clap(
11 name = "padmet",
12 bin_name = "padmet",
13 version = "0.1.0",
14 author = "Samuel Ortion <>"
15)]
16pub struct Arguments {
17 #[clap(short = 'i', long = "input")]
19 input: String,
20
21 #[clap(short = 'q', long = "quiet")]
24 quiet: bool,
25
26 #[clap(short = 'v', long = "verbosity", action = clap::ArgAction::Count)]
28 verbosity: u8,
29
30 #[clap(short = 'T', long = "timestamp")]
32 ts: Option<stderrlog::Timestamp>,
33}
34
35impl Arguments {
36 pub fn input(&self) -> Vec<u8> {
38 self.input.as_bytes().to_vec()
39 }
40
41 pub fn verbosity(&self) -> usize {
43 self.verbosity as usize
44 }
45
46 pub fn quiet(&self) -> bool {
48 self.quiet
49 }
50
51 pub fn timestamp(&self) -> stderrlog::Timestamp {
53 self.ts.unwrap_or(stderrlog::Timestamp::Off)
54 }
55}