extern crate clap;
extern crate hum;
fn main() {
let matches = clap::Command::new("hum")
.version(hum::VERSION)
.author(hum::AUTHOR)
.about(hum::ABOUT)
.arg(
clap::Arg::new("INPUT")
.help("Sets the path of the hum notation file.")
.required(true)
.index(1)
)
.arg(
clap::Arg::new("OUTPUT")
.help("Sets the path of the output WAV file.")
.required(true)
.index(2)
)
.get_matches();
let input = matches.get_one::<String>("INPUT").unwrap();
let output = matches.get_one::<String>("OUTPUT").unwrap();
let score_contents = hum::hum_io::read(input)
.expect("There was a problem reading the score file.");
match hum::convert_to_wav(score_contents, output) {
Ok(_) => {},
Err(message) => eprintln!("{}", message),
}
}