use tek_core::clap::{self, Parser}; use crate::*; #[derive(Debug, Parser)] #[command(version, about, long_about = None)] pub struct MixerCli { /// Name of JACK client #[arg(short, long)] name: Option, /// Number of tracks #[arg(short, long)] channels: Option, } impl Mixer { pub fn from_args () -> Usually { let args = MixerCli::parse(); let mut mix = Self::new("")?; if let Some(name) = args.name { mix.name = name.clone(); } if let Some(channels) = args.channels { for channel in 0..channels { mix.track_add(&format!("Track {}", channel + 1), 1)?; } } Ok(mix) } }