Print help by default
This commit is contained in:
parent
7563c3ef46
commit
97359801c2
2 changed files with 12 additions and 7 deletions
|
@ -109,7 +109,7 @@ impl Service for RelayServer {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn args() -> App<'static, 'static> {
|
||||
pub fn options() -> App<'static, 'static> {
|
||||
SubCommand::with_name("relay")
|
||||
.about("Hosts an HTTP-based relay server")
|
||||
.arg(Arg::with_name("listen")
|
||||
|
|
17
src/main.rs
17
src/main.rs
|
@ -8,17 +8,22 @@ mod commands;
|
|||
use clap::{App, AppSettings};
|
||||
use commands::{relay};
|
||||
|
||||
fn main() {
|
||||
let args = App::new("webmetro")
|
||||
fn options() -> App<'static, 'static> {
|
||||
App::new("webmetro")
|
||||
.version(crate_version!())
|
||||
.about("Utilities for broadcasting & relaying live WebM video/audio streams")
|
||||
.setting(AppSettings::SubcommandRequired)
|
||||
.setting(AppSettings::VersionlessSubcommands)
|
||||
.subcommand(relay::args())
|
||||
.get_matches();
|
||||
.subcommand(relay::options())
|
||||
}
|
||||
|
||||
fn main() {
|
||||
let args = options().get_matches();
|
||||
|
||||
match args.subcommand() {
|
||||
("relay", Some(sub_args)) => relay::run(sub_args),
|
||||
_ => {}
|
||||
_ => {
|
||||
options().print_help().unwrap();
|
||||
println!("")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue