From e8e2bb6b41e5e19f8a433dcff597369af2218a92 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Thu, 26 Oct 2017 00:17:01 -0700 Subject: work in progress on network connection --- src/bin/geniza-net.rs | 7 +++++-- src/bin/geniza-register.rs | 3 +++ src/bin/geniza-sleep.rs | 3 +++ 3 files changed, 11 insertions(+), 2 deletions(-) (limited to 'src/bin') diff --git a/src/bin/geniza-net.rs b/src/bin/geniza-net.rs index de97e88..1f369ab 100644 --- a/src/bin/geniza-net.rs +++ b/src/bin/geniza-net.rs @@ -2,6 +2,7 @@ #[macro_use] extern crate error_chain; extern crate clap; +extern crate env_logger; extern crate geniza; // TODO: more careful import @@ -9,6 +10,8 @@ use geniza::*; use clap::{App, SubCommand}; fn run() -> Result<()> { + + env_logger::init().unwrap(); let matches = App::new("geniza-net") .version(env!("CARGO_PKG_VERSION")) @@ -16,7 +19,7 @@ fn run() -> Result<()> { .about("Connects to a peer and exchanges handshake") .arg_from_usage(" 'peer host:port to connect to'") .arg_from_usage(" 'dat key (public key) to register with'")) - .subcommand(SubCommand::with_name("clone") + .subcommand(SubCommand::with_name("receive-all") .about("Connects to a peer, pulls all metadata and content") .arg_from_usage(" 'peer host:port to connect to'") .arg_from_usage(" 'dat key (public key) to register with'")) @@ -44,7 +47,7 @@ fn run() -> Result<()> { false)?; println!("Done!"); }, - ("clone", Some(subm)) => { + ("receive-all", Some(subm)) => { let host_port = subm.value_of("host_port").unwrap(); let dat_key = subm.value_of("dat_key").unwrap(); if dat_key.len() != 32*2 { diff --git a/src/bin/geniza-register.rs b/src/bin/geniza-register.rs index d0f48d8..a328bbc 100644 --- a/src/bin/geniza-register.rs +++ b/src/bin/geniza-register.rs @@ -2,6 +2,7 @@ #[macro_use] extern crate error_chain; extern crate clap; +extern crate env_logger; extern crate geniza; // TODO: more careful import @@ -10,6 +11,8 @@ use std::path::Path; use clap::{App, SubCommand}; fn run() -> Result<()> { + + env_logger::init().unwrap(); let matches = App::new("geniza-register") .version(env!("CARGO_PKG_VERSION")) diff --git a/src/bin/geniza-sleep.rs b/src/bin/geniza-sleep.rs index f8921c7..10fc16b 100644 --- a/src/bin/geniza-sleep.rs +++ b/src/bin/geniza-sleep.rs @@ -3,6 +3,7 @@ extern crate error_chain; #[macro_use] extern crate clap; +extern crate env_logger; extern crate geniza; // TODO: more careful import @@ -11,6 +12,8 @@ use std::path::Path; use clap::{App, SubCommand}; fn run() -> Result<()> { + + env_logger::init().unwrap(); let matches = App::new("geniza-sleep") .version(env!("CARGO_PKG_VERSION")) -- cgit v1.2.3