webmetro/src/main.rs

44 lines
1.1 KiB
Rust
Raw Normal View History

2018-04-11 05:39:28 +00:00
#[macro_use] extern crate clap;
extern crate futures;
extern crate hyper;
extern crate tokio;
extern crate tokio_io;
2018-04-11 05:39:28 +00:00
extern crate webmetro;
mod commands;
use clap::{App, AppSettings};
use commands::{
relay,
2018-04-12 06:03:46 +00:00
filter,
dump
};
2018-04-11 05:50:18 +00:00
fn options() -> App<'static, 'static> {
App::new("webmetro")
.version(crate_version!())
.about("Utilities for broadcasting & relaying live WebM video/audio streams")
.setting(AppSettings::VersionlessSubcommands)
2018-04-11 05:50:18 +00:00
.subcommand(relay::options())
2018-04-12 06:03:46 +00:00
.subcommand(filter::options())
.subcommand(dump::options())
2018-04-11 05:50:18 +00:00
}
fn main() {
let args = options().get_matches();
match args.subcommand() {
2018-04-12 06:03:46 +00:00
("filter", Some(sub_args)) => filter::run(sub_args),
2018-04-11 05:39:28 +00:00
("relay", Some(sub_args)) => relay::run(sub_args),
("dump", Some(sub_args)) => dump::run(sub_args),
2018-04-11 05:50:18 +00:00
_ => {
options().print_help().unwrap();
2018-04-11 23:45:02 +00:00
println!("");
Ok(())
2018-04-11 05:50:18 +00:00
}
2018-04-14 22:44:09 +00:00
}.unwrap_or_else(|err| {
println!("Error: {}", err);
::std::process::exit(1);
});
}