aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYour Name <you@example.com>2020-05-03 20:06:12 +0200
committerYour Name <you@example.com>2020-05-03 20:06:12 +0200
commita3d33d3e680f19c0d61911d64d9e4c30a07f55ab (patch)
treebfd791d4c0ec9430511a2431d1f04c969f552442
parenteb917c35008d32b3b27bf132b5f831f05888be54 (diff)
downloadrust-zotapi-a3d33d3e680f19c0d61911d64d9e4c30a07f55ab.tar.gz
rust-zotapi-a3d33d3e680f19c0d61911d64d9e4c30a07f55ab.tar.bz2
rust-zotapi-a3d33d3e680f19c0d61911d64d9e4c30a07f55ab.zip
Promote example app to proper command line client.
-rw-r--r--Cargo.toml4
-rw-r--r--src/bin/zot/main.rs (renamed from examples/zotcli.rs)6
-rw-r--r--src/bin/zot/zot/abconfig.rs (renamed from examples/zot/abconfig.rs)0
-rw-r--r--src/bin/zot/zot/abook.rs (renamed from examples/zot/abook.rs)0
-rw-r--r--src/bin/zot/zot/channel_stream.rs (renamed from examples/zot/channel_stream.rs)0
-rw-r--r--src/bin/zot/zot/group.rs (renamed from examples/zot/group.rs)0
-rw-r--r--src/bin/zot/zot/item.rs (renamed from examples/zot/item.rs)0
-rw-r--r--src/bin/zot/zot/mod.rs (renamed from examples/zot/mod.rs)0
-rw-r--r--src/bin/zot/zot/network_stream.rs (renamed from examples/zot/network_stream.rs)0
-rw-r--r--src/bin/zot/zot/xchan.rs (renamed from examples/zot/xchan.rs)0
10 files changed, 5 insertions, 5 deletions
diff --git a/Cargo.toml b/Cargo.toml
index d985740..c88cdd0 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -21,6 +21,8 @@ authors = ["haraldei"]
edition = "2018"
[dependencies]
+clap = "2.33.0"
+dotenv = "0.13"
reqwest = "0.9.1"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
@@ -29,7 +31,5 @@ url = "2.1"
[dev-dependencies]
base64 = "0.11.0"
-clap = "2.33.0"
-dotenv = "0.13"
mockito = "0.25"
serde_json = "1.0"
diff --git a/examples/zotcli.rs b/src/bin/zot/main.rs
index 0be566f..5828f44 100644
--- a/examples/zotcli.rs
+++ b/src/bin/zot/main.rs
@@ -15,7 +15,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-use clap::{clap_app, crate_authors, crate_description, crate_name, crate_version};
+use clap::{clap_app, crate_authors, crate_version};
use dotenv::dotenv;
use std::env;
use std::str::FromStr;
@@ -29,10 +29,10 @@ fn main() {
let password = env::var("HZ_PASSWORD").expect("PASSWORD variable expected");
let matches = clap_app!(app =>
- (name: crate_name!())
+ (name: "zot")
(version: crate_version!())
(author: crate_authors!())
- (about: crate_description!())
+ (about: "zotapi command line client")
(@subcommand channel =>
(about: "Fetch the channel stream")
(@arg raw: --raw "Display raw json payload")
diff --git a/examples/zot/abconfig.rs b/src/bin/zot/zot/abconfig.rs
index 2e357e4..2e357e4 100644
--- a/examples/zot/abconfig.rs
+++ b/src/bin/zot/zot/abconfig.rs
diff --git a/examples/zot/abook.rs b/src/bin/zot/zot/abook.rs
index 97025c3..97025c3 100644
--- a/examples/zot/abook.rs
+++ b/src/bin/zot/zot/abook.rs
diff --git a/examples/zot/channel_stream.rs b/src/bin/zot/zot/channel_stream.rs
index bad7152..bad7152 100644
--- a/examples/zot/channel_stream.rs
+++ b/src/bin/zot/zot/channel_stream.rs
diff --git a/examples/zot/group.rs b/src/bin/zot/zot/group.rs
index 9264cdc..9264cdc 100644
--- a/examples/zot/group.rs
+++ b/src/bin/zot/zot/group.rs
diff --git a/examples/zot/item.rs b/src/bin/zot/zot/item.rs
index 648a9f0..648a9f0 100644
--- a/examples/zot/item.rs
+++ b/src/bin/zot/zot/item.rs
diff --git a/examples/zot/mod.rs b/src/bin/zot/zot/mod.rs
index 706f496..706f496 100644
--- a/examples/zot/mod.rs
+++ b/src/bin/zot/zot/mod.rs
diff --git a/examples/zot/network_stream.rs b/src/bin/zot/zot/network_stream.rs
index 0e6edb4..0e6edb4 100644
--- a/examples/zot/network_stream.rs
+++ b/src/bin/zot/zot/network_stream.rs
diff --git a/examples/zot/xchan.rs b/src/bin/zot/zot/xchan.rs
index 088d49c..088d49c 100644
--- a/examples/zot/xchan.rs
+++ b/src/bin/zot/zot/xchan.rs