diff options
author | Harald Eilertsen <haraldei@anduin.net> | 2018-10-08 19:57:23 +0200 |
---|---|---|
committer | Harald Eilertsen <haraldei@anduin.net> | 2018-10-08 20:05:31 +0200 |
commit | 2d8e3c5cd1cc3fdcec838710af377bfa32718fbd (patch) | |
tree | a7bb2c90f9e2ab78ccf78bd6d29d72482adba583 /examples/zot.rs | |
parent | fc7735d33a562f71729e96514b722db7d6f55f05 (diff) | |
download | rust-zotapi-2d8e3c5cd1cc3fdcec838710af377bfa32718fbd.tar.gz rust-zotapi-2d8e3c5cd1cc3fdcec838710af377bfa32718fbd.tar.bz2 rust-zotapi-2d8e3c5cd1cc3fdcec838710af377bfa32718fbd.zip |
Add abook api to main example.
Diffstat (limited to 'examples/zot.rs')
-rw-r--r-- | examples/zot.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/examples/zot.rs b/examples/zot.rs index 2c49fe3..5fa4f09 100644 --- a/examples/zot.rs +++ b/examples/zot.rs @@ -25,6 +25,7 @@ use clap::{Arg, SubCommand}; use dotenv::dotenv; use std::env; +mod abook; mod channel_stream; mod network_stream; @@ -47,6 +48,12 @@ fn main() { .arg(Arg::with_name("raw") .long("raw") .help("Display raw json payload"))) + .subcommand( + SubCommand::with_name("abook") + .about("Fetch address book/contact info") + .arg(Arg::with_name("raw") + .long("raw") + .help("Display raw json payload"))) .get_matches(); let client = zotapi::client(&site, &user, &password); @@ -60,6 +67,10 @@ fn main() { let raw = m.is_present("raw"); network_stream::fetch(&client, raw); }, + ("abook", Some(m)) => { + let raw = m.is_present("raw"); + abook::fetch(&client, raw); + }, _ => { println!("{}", matches.usage()); }, |