2022-05-23 00:37:03 +00:00
|
|
|
#[macro_use]
|
|
|
|
extern crate log;
|
2019-11-19 06:52:52 +00:00
|
|
|
|
2018-04-11 05:39:28 +00:00
|
|
|
mod commands;
|
2018-04-11 04:55:41 +00:00
|
|
|
|
2022-05-23 00:37:03 +00:00
|
|
|
use clap::{Parser, Subcommand};
|
2018-04-15 02:34:46 +00:00
|
|
|
|
2022-05-23 00:37:03 +00:00
|
|
|
/// Utilities for broadcasting & relaying live WebM video/audio streams
|
|
|
|
#[derive(Parser, Debug)]
|
|
|
|
#[clap(version)]
|
|
|
|
struct Args {
|
|
|
|
#[clap(subcommand)]
|
|
|
|
command: Command,
|
|
|
|
}
|
2018-04-11 04:55:41 +00:00
|
|
|
|
2022-05-23 00:37:03 +00:00
|
|
|
#[derive(Subcommand, Debug)]
|
|
|
|
enum Command {
|
|
|
|
Dump(commands::dump::DumpArgs),
|
|
|
|
Filter(commands::filter::FilterArgs),
|
|
|
|
Relay(commands::relay::RelayArgs),
|
|
|
|
Send(commands::send::SendArgs),
|
2018-04-11 05:50:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
2019-11-19 07:01:08 +00:00
|
|
|
env_logger::init();
|
2022-05-23 00:37:03 +00:00
|
|
|
let args = Args::parse();
|
2018-04-11 04:55:41 +00:00
|
|
|
|
2022-05-23 00:37:03 +00:00
|
|
|
match args.command {
|
|
|
|
Command::Dump(args) => commands::dump::run(args),
|
|
|
|
Command::Filter(args) => commands::filter::run(args),
|
|
|
|
Command::Relay(args) => commands::relay::run(args),
|
|
|
|
Command::Send(args) => commands::send::run(args),
|
|
|
|
}
|
|
|
|
.unwrap_or_else(|err| {
|
2019-11-19 06:52:52 +00:00
|
|
|
error!("{}", err);
|
2018-10-21 03:02:24 +00:00
|
|
|
});
|
2018-04-15 02:34:46 +00:00
|
|
|
}
|