Removed call to 'banner' from external modules

This commit is contained in:
Jedrzej Stuczynski
2020-01-20 10:32:07 +00:00
parent 3737c535ff
commit 32a978d932
4 changed files with 12 additions and 11 deletions
-2
View File
@@ -1,11 +1,9 @@
use crate::banner;
use crate::persistence::pathfinder::Pathfinder;
use crate::persistence::pemstore::PemStore;
use clap::ArgMatches;
use crypto::identity::MixnetIdentityKeyPair;
pub fn execute(matches: &ArgMatches) {
println!("{}", banner());
println!("Initialising client...");
let id = matches.value_of("id").unwrap().to_string(); // required for now
-3
View File
@@ -1,4 +1,3 @@
use crate::banner;
use crate::clients::{NymClient, SocketType};
use crate::persistence::pemstore;
@@ -7,8 +6,6 @@ use crypto::identity::{MixnetIdentityKeyPair, MixnetIdentityPublicKey};
use std::net::ToSocketAddrs;
pub fn execute(matches: &ArgMatches) {
println!("{}", banner());
let id = matches.value_of("id").unwrap().to_string();
let port = match matches.value_of("port").unwrap_or("9001").parse::<u16>() {
Ok(n) => n,
-3
View File
@@ -1,4 +1,3 @@
use crate::banner;
use crate::clients::{NymClient, SocketType};
use crate::persistence::pemstore;
@@ -7,8 +6,6 @@ use crypto::identity::{MixnetIdentityKeyPair, MixnetIdentityPublicKey};
use std::net::ToSocketAddrs;
pub fn execute(matches: &ArgMatches) {
println!("{}", banner());
let id = matches.value_of("id").unwrap().to_string();
let port = match matches.value_of("port").unwrap_or("9001").parse::<u16>() {
Ok(n) => n,
+12 -3
View File
@@ -91,9 +91,18 @@ fn main() {
fn execute(matches: ArgMatches) -> Result<(), String> {
match matches.subcommand() {
("init", Some(m)) => Ok(commands::init::execute(m)),
("tcpsocket", Some(m)) => Ok(commands::tcpsocket::execute(m)),
("websocket", Some(m)) => Ok(commands::websocket::execute(m)),
("init", Some(m)) => {
println!("{}", banner());
Ok(commands::init::execute(m))
}
("tcpsocket", Some(m)) => {
println!("{}", banner());
Ok(commands::tcpsocket::execute(m))
}
("websocket", Some(m)) => {
println!("{}", banner());
Ok(commands::websocket::execute(m))
}
_ => Err(usage()),
}
}