#[derive(clap::Parser, std::fmt::Debug)]
#[clap(
name = "padmet",
bin_name = "padmet",
version = "0.1.0",
author = "Samuel Ortion <>"
)]
pub struct Arguments {
#[clap(short = 'i', long = "input")]
input: String,
#[clap(short = 'q', long = "quiet")]
quiet: bool,
#[clap(short = 'v', long = "verbosity", action = clap::ArgAction::Count)]
verbosity: u8,
#[clap(short = 'T', long = "timestamp")]
ts: Option<stderrlog::Timestamp>,
}
impl Arguments {
pub fn input(&self) -> Vec<u8> {
self.input.as_bytes().to_vec()
}
pub fn verbosity(&self) -> usize {
self.verbosity as usize
}
pub fn quiet(&self) -> bool {
self.quiet
}
pub fn timestamp(&self) -> stderrlog::Timestamp {
self.ts.unwrap_or(stderrlog::Timestamp::Off)
}
}