aboutsummaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorHarald Eilertsen <haraldei@anduin.net>2018-10-28 22:12:17 +0100
committerHarald Eilertsen <haraldei@anduin.net>2018-10-28 22:24:42 +0100
commit75dcb1e9dc2c554e7193daeb1a84157fbcd8603d (patch)
tree867972dda090d5ab287755f00498119bb2934332 /examples
parent8760299b1c5ca352db2146c5ed63a3ed8bd2c599 (diff)
downloadrust-zotapi-75dcb1e9dc2c554e7193daeb1a84157fbcd8603d.tar.gz
rust-zotapi-75dcb1e9dc2c554e7193daeb1a84157fbcd8603d.tar.bz2
rust-zotapi-75dcb1e9dc2c554e7193daeb1a84157fbcd8603d.zip
Move zot cli example modules into submodule.
Also rename example from zot to zotcli to avoid name clash.
Diffstat (limited to 'examples')
-rw-r--r--examples/zot/abook.rs (renamed from examples/abook.rs)0
-rw-r--r--examples/zot/channel_stream.rs (renamed from examples/channel_stream.rs)0
-rw-r--r--examples/zot/mod.rs4
-rw-r--r--examples/zot/network_stream.rs (renamed from examples/network_stream.rs)0
-rw-r--r--examples/zot/xchan.rs (renamed from examples/xchan.rs)0
-rw-r--r--examples/zotcli.rs (renamed from examples/zot.rs)19
6 files changed, 12 insertions, 11 deletions
diff --git a/examples/abook.rs b/examples/zot/abook.rs
index bceaacc..bceaacc 100644
--- a/examples/abook.rs
+++ b/examples/zot/abook.rs
diff --git a/examples/channel_stream.rs b/examples/zot/channel_stream.rs
index a278244..a278244 100644
--- a/examples/channel_stream.rs
+++ b/examples/zot/channel_stream.rs
diff --git a/examples/zot/mod.rs b/examples/zot/mod.rs
new file mode 100644
index 0000000..089a4cb
--- /dev/null
+++ b/examples/zot/mod.rs
@@ -0,0 +1,4 @@
+pub mod abook;
+pub mod channel_stream;
+pub mod network_stream;
+pub mod xchan;
diff --git a/examples/network_stream.rs b/examples/zot/network_stream.rs
index de3b12f..de3b12f 100644
--- a/examples/network_stream.rs
+++ b/examples/zot/network_stream.rs
diff --git a/examples/xchan.rs b/examples/zot/xchan.rs
index d37328d..d37328d 100644
--- a/examples/xchan.rs
+++ b/examples/zot/xchan.rs
diff --git a/examples/zot.rs b/examples/zotcli.rs
index 3ad9bf0..2804754 100644
--- a/examples/zot.rs
+++ b/examples/zotcli.rs
@@ -25,10 +25,7 @@ use clap::{Arg, SubCommand};
use dotenv::dotenv;
use std::env;
-mod abook;
-mod channel_stream;
-mod network_stream;
-mod xchan;
+mod zot;
fn main() {
dotenv().ok();
@@ -80,29 +77,29 @@ fn main() {
match matches.subcommand() {
("channel-stream", Some(m)) => {
let raw = m.is_present("raw");
- channel_stream::fetch(&client, raw);
+ zot::channel_stream::fetch(&client, raw);
},
("network-stream", Some(m)) => {
let raw = m.is_present("raw");
- network_stream::fetch(&client, raw);
+ zot::network_stream::fetch(&client, raw);
},
("abook", Some(m)) => {
let raw = m.is_present("raw");
- abook::fetch(&client, raw);
+ zot::abook::fetch(&client, raw);
},
("xchan", Some(m)) => {
let raw = m.is_present("raw");
let t = if m.is_present("guid") {
- xchan::Type::GUID
+ zot::xchan::Type::GUID
}
else if m.is_present("hash") {
- xchan::Type::Hash
+ zot::xchan::Type::Hash
}
else {
- xchan::Type::Addr
+ zot::xchan::Type::Addr
};
- xchan::fetch(&client, raw, t, m.value_of("ID").unwrap());
+ zot::xchan::fetch(&client, raw, t, m.value_of("ID").unwrap());
},
_ => {
println!("{}", matches.usage());