Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- use clap::Parser;
- #[derive(Parser)]
- #[command(name = "Audio Length")]
- #[command(author = "Fabio A <faraujo@almawave.con.br>")]
- #[command(version = "0.01")]
- #[command(about = "It takes the time in seconds of audio files in a directory and writes the results in a csv file.")]
- pub struct Cli {
- #[arg(value_name = "client name")]
- #[arg(required = true)]
- pub op: Option<String>,
- #[arg(short, value_name = "source audio directory")]
- #[arg(default_value = ".")]
- pub src: Option<String>,
- #[arg(short, value_name = "save the csv file in...")]
- #[arg(default_value = ".")]
- pub dst: Option<String>,
- }
- impl Cli {
- pub fn new() -> Cli {
- let arg = Cli::parse();
- Cli {
- src: arg.src,
- dst: arg.dst,
- op: arg.op,
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement