diff --git a/rust-whisper/Cargo.lock b/rust-whisper/Cargo.lock index 89ffdc9..dff8e4d 100644 --- a/rust-whisper/Cargo.lock +++ b/rust-whisper/Cargo.lock @@ -871,6 +871,7 @@ checksum = "b9b1a3d5f46d53f4a3478e2be4a5a5ce5108ea58b100dcd139830eae7f79a3a1" name = "rust-whisper" version = "0.1.0" dependencies = [ + "clap", "rust-whisper-lib", ] diff --git a/rust-whisper/Cargo.toml b/rust-whisper/Cargo.toml index 46279ed..ef108af 100644 --- a/rust-whisper/Cargo.toml +++ b/rust-whisper/Cargo.toml @@ -7,3 +7,4 @@ edition = "2021" [dependencies] rust-whisper-lib = { path = "../rust-whisper-lib" } +clap = { version = "4.4.10", features = ["derive"] } diff --git a/rust-whisper/src/main.rs b/rust-whisper/src/main.rs index e7a11a9..2e99a2e 100644 --- a/rust-whisper/src/main.rs +++ b/rust-whisper/src/main.rs @@ -1,3 +1,15 @@ +use rust_whisper_lib; +use clap::Parser; + fn main() { - println!("Hello, world!"); + let flags = rust_whisper_lib::Flags::parse(); + rust_whisper_lib::main( + flags, + |result: Result| { + match result { + Ok(whispered) => { println!("{}", whispered.to_string()); }, + Err(msg) => { eprintln!("error: {}", msg); }, + }; + }, + ); }