omni_dev/cli/transcript/
mod.rs1pub mod format;
8pub mod youtube;
9
10use anyhow::Result;
11use clap::{Parser, Subcommand};
12
13#[derive(Parser)]
15pub struct TranscriptCommand {
16 #[command(subcommand)]
18 pub command: TranscriptSubcommands,
19}
20
21#[derive(Subcommand)]
23pub enum TranscriptSubcommands {
24 Youtube(youtube::YoutubeCommand),
26}
27
28impl TranscriptCommand {
29 pub async fn execute(self) -> Result<()> {
31 match self.command {
32 TranscriptSubcommands::Youtube(cmd) => cmd.execute().await,
33 }
34 }
35}
36
37#[cfg(test)]
38mod tests {
39 use super::*;
40
41 #[test]
42 fn transcript_subcommands_youtube_variant() {
43 let cmd = TranscriptCommand {
44 command: TranscriptSubcommands::Youtube(youtube::YoutubeCommand {
45 command: youtube::YoutubeSubcommands::Info(youtube::info::InfoCommand {
46 url: "https://youtu.be/dQw4w9WgXcQ".to_string(),
47 output: youtube::info::InfoOutput::Table,
48 }),
49 }),
50 };
51 assert!(matches!(cmd.command, TranscriptSubcommands::Youtube(_)));
52 }
53}