From e495ad704e7b40163c5c5b59605904bbd8e5292c Mon Sep 17 00:00:00 2001 From: Jamie Hardt Date: Fri, 1 Jan 2021 23:13:17 -0800 Subject: [PATCH] Added CLI options --- examples/wave-deinter.rs | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/examples/wave-deinter.rs b/examples/wave-deinter.rs index f44c56a..7c1ac2f 100644 --- a/examples/wave-deinter.rs +++ b/examples/wave-deinter.rs @@ -4,7 +4,41 @@ //! This program demonstrats combining several wave files into a single //! polyphonic wave file. -fn main() -> std::io::Result<()> { +extern crate clap; + +use std::io; +use clap::{Arg, App}; + +fn main() -> io::Result<()> { + + let matches = App::new("wave-deinter") + .version("0.1") + .author("Jamie Hardt") + .about("Extract each channel of a polyphonic wave file as a new monoaural wave file.") + .arg(Arg::with_name("OUTPUT") + .long("output") + .short("o") + .help("Output file basename. If absent, will be the basename of INPUT.") + ) + .arg(Arg::with_name("numeric_names") + .long("numeric") + .short("n") + .help("Use numeric channel names \"01\" \"02\" etc.") + .takes_value(false) + ) + .arg(Arg::with_name("channel_delimiter") + .long("delim") + .short("d") + .help("Channel label delimiter.") + .default_value(".") + ) + .arg(Arg::with_name("INPUT") + .help("Input wave file") + .required(true) + ) + .get_matches(); + + println!("Command line opts: {:?}", matches); Ok(()) } \ No newline at end of file