Skip to content
This repository has been archived by the owner on Sep 7, 2024. It is now read-only.

Commit

Permalink
feat: initializing cli for node initing and running
Browse files Browse the repository at this point in the history
  • Loading branch information
kehiy committed Dec 25, 2023
1 parent ff3e987 commit 571008a
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 2 deletions.
3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
clap = { version = "4.4.11", features = ["cargo"] }


[workspace]
Expand All @@ -17,4 +18,4 @@ members = [
"node",
"rpc",
"config"
]
]
24 changes: 23 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,25 @@
use clap::*;

fn main() {
println!("Hello, world!");
let init_command = command!()
.name("init")
.about("Initializing a Redvin node.")
.arg(
Arg::new("working-directory")
.long("working-directory")
.short('w')
.help("Working directory is the path for saving relay, peers data and some other stuff for managing node.")
.aliases(["workdir", "wdir", "workingdirectory", "workingdir", "wdirectory"])
.required(true)
);

let start_command = command!()
.name("start")
.about("Starting a Redvin instance by passing a working directory.");

let _root_command = command!()
.about("Redvin is an IPNN implementation in rust, helping to build decentralized future.")
.subcommand(init_command)
.subcommand(start_command)
.get_matches();
}

0 comments on commit 571008a

Please sign in to comment.