Smoothing out the cli output a bit

This commit is contained in:
Dave Hrycyszyn
2024-05-29 16:47:35 +01:00
parent dcb14801da
commit f6b5825cea
3 changed files with 9 additions and 3 deletions

View File

@@ -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
View File

@@ -0,0 +1,3 @@
pub(crate) fn init() {
println!("Initializing Side Node")
}

View File

@@ -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."),
} }
} }