diff --git a/nym-client/Cargo.toml b/nym-client/Cargo.toml index e2276544c9..53bfe0e9a1 100644 --- a/nym-client/Cargo.toml +++ b/nym-client/Cargo.toml @@ -7,6 +7,10 @@ edition = "2018" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html +[lib] +name = "nym_client" +path = "src/lib.rs" + [dependencies] base64 = "0.11.0" clap = "2.33.0" diff --git a/nym-client/src/built_info.rs b/nym-client/src/built_info.rs new file mode 100644 index 0000000000..d11fb6389f --- /dev/null +++ b/nym-client/src/built_info.rs @@ -0,0 +1,2 @@ +// The file has been placed there by the build script. +include!(concat!(env!("OUT_DIR"), "/built.rs")); diff --git a/nym-client/src/commands/init.rs b/nym-client/src/commands/init.rs index ce6ee879b4..f6d675ea02 100644 --- a/nym-client/src/commands/init.rs +++ b/nym-client/src/commands/init.rs @@ -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 diff --git a/nym-client/src/commands/tcpsocket.rs b/nym-client/src/commands/tcpsocket.rs index 97b258101e..3ed3662c7b 100644 --- a/nym-client/src/commands/tcpsocket.rs +++ b/nym-client/src/commands/tcpsocket.rs @@ -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::() { Ok(n) => n, diff --git a/nym-client/src/commands/websocket.rs b/nym-client/src/commands/websocket.rs index 4b27bc3455..99dbc1ecc6 100644 --- a/nym-client/src/commands/websocket.rs +++ b/nym-client/src/commands/websocket.rs @@ -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::() { Ok(n) => n, diff --git a/nym-client/src/lib.rs b/nym-client/src/lib.rs new file mode 100644 index 0000000000..5fa9078897 --- /dev/null +++ b/nym-client/src/lib.rs @@ -0,0 +1,8 @@ +#![recursion_limit = "256"] + +pub mod built_info; +pub mod clients; +pub mod commands; +pub mod persistence; +pub mod sockets; +pub mod utils; diff --git a/nym-client/src/main.rs b/nym-client/src/main.rs index 26472e6352..8455bc7287 100644 --- a/nym-client/src/main.rs +++ b/nym-client/src/main.rs @@ -2,15 +2,12 @@ use clap::{App, Arg, ArgMatches, SubCommand}; +pub mod built_info; pub mod clients; mod commands; mod persistence; mod sockets; pub mod utils; -pub mod built_info { - // The file has been placed there by the build script. - include!(concat!(env!("OUT_DIR"), "/built.rs")); -} fn main() { env_logger::init();