From 1caa9f564e46a5b6d54b5d9459f53f71250cd0ed Mon Sep 17 00:00:00 2001 From: Bel LaPointe <153096461+breel-render@users.noreply.github.com> Date: Tue, 19 Dec 2023 21:59:34 -0500 Subject: [PATCH] cmd imports rust-whisper-lib --- rust-whisper/Cargo.lock | 1 + rust-whisper/Cargo.toml | 1 + rust-whisper/src/main.rs | 14 +++++++++++++- 3 files changed, 15 insertions(+), 1 deletion(-) 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); }, + }; + }, + ); }