Breaking websocket functionality out into its own module

This commit is contained in:
Dave Hrycyszyn
2024-05-29 16:35:00 +01:00
parent 8e290f8bef
commit dcb14801da
3 changed files with 30 additions and 31 deletions

View File

@@ -1,20 +1,9 @@
use clap::{arg, Parser, Subcommand};
use clap::Parser;
use clap::Subcommand;
pub(crate) fn parse_args() -> Args {
let args = Args::parse();
match &args.command {
Some(Commands::Init { init }) => {
if *init {
println!("Initializing Side Node")
}
}
Some(Commands::Run {}) => {
println!("Running side node")
}
None => todo!(),
}
args
}
@@ -23,16 +12,12 @@ pub(crate) fn parse_args() -> Args {
#[command(version, about, long_about = None)]
pub(crate) struct Args {
#[command(subcommand)]
command: Option<Commands>,
pub(crate) command: Option<Commands>,
}
#[derive(Subcommand)]
enum Commands {
pub(crate) enum Commands {
/// runs the Side Node
Run {},
Init {
/// initializes a Side Node with a config file and keypair
#[arg(short, long)]
init: bool,
},
Init {},
}