Smoothing out the cli output a bit
This commit is contained in:
@@ -7,7 +7,7 @@ pub(crate) fn parse_args() -> Args {
|
|||||||
args
|
args
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Simple program to greet a person
|
/// A P2P smart contract execution node
|
||||||
#[derive(Parser)]
|
#[derive(Parser)]
|
||||||
#[command(version, about, long_about = None)]
|
#[command(version, about, long_about = None)]
|
||||||
pub(crate) struct Args {
|
pub(crate) struct Args {
|
||||||
@@ -19,5 +19,7 @@ pub(crate) struct Args {
|
|||||||
pub(crate) enum Commands {
|
pub(crate) enum Commands {
|
||||||
/// runs the Side Node
|
/// runs the Side Node
|
||||||
Run {},
|
Run {},
|
||||||
|
|
||||||
|
/// initializes the Side Node with a new keypair
|
||||||
Init {},
|
Init {},
|
||||||
}
|
}
|
||||||
|
|||||||
3
side-node/src/init.rs
Normal file
3
side-node/src/init.rs
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
pub(crate) fn init() {
|
||||||
|
println!("Initializing Side Node")
|
||||||
|
}
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
use cli::{parse_args, Commands};
|
use cli::{parse_args, Commands};
|
||||||
|
|
||||||
pub(crate) mod cli;
|
pub(crate) mod cli;
|
||||||
|
pub(crate) mod init;
|
||||||
pub(crate) mod websocket;
|
pub(crate) mod websocket;
|
||||||
|
|
||||||
#[tokio::main]
|
#[tokio::main]
|
||||||
@@ -9,11 +10,11 @@ async fn main() {
|
|||||||
|
|
||||||
match &args.command {
|
match &args.command {
|
||||||
Some(Commands::Init {}) => {
|
Some(Commands::Init {}) => {
|
||||||
println!("Initializing Side Node")
|
init::init();
|
||||||
}
|
}
|
||||||
Some(Commands::Run {}) => {
|
Some(Commands::Run {}) => {
|
||||||
websocket::start().await.unwrap();
|
websocket::start().await.unwrap();
|
||||||
}
|
}
|
||||||
None => todo!(),
|
None => println!("No command provided. Exiting. See --help for more information."),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user