mod dump;
mod epg;
mod pids;
mod services;
mod t2mi;
mod util;
use std::process::ExitCode;
use clap::{Parser, Subcommand};
#[derive(Parser)]
#[command(name = "dvb-tools", version, about, long_about = None)]
struct Cli {
#[command(subcommand)]
command: Command,
}
#[derive(Subcommand)]
enum Command {
Dump {
file: String,
#[arg(long)]
json: bool,
},
Services {
file: String,
},
Epg {
file: String,
#[arg(long)]
json: bool,
},
Pids {
file: String,
},
T2mi {
file: String,
#[arg(long)]
pid: Option<String>,
#[arg(long)]
inner: bool,
#[arg(long)]
plp: Option<u8>,
},
}
fn main() -> ExitCode {
match Cli::parse().command {
Command::Dump { file, json } => dump::run(&file, json),
Command::Services { file } => services::run(&file),
Command::Epg { file, json } => epg::run(&file, json),
Command::Pids { file } => pids::run(&file),
Command::T2mi {
file,
pid,
inner,
plp,
} => t2mi::run(&file, pid.as_deref(), inner, plp),
}
}