init binary + initial clap

This commit is contained in:
Jędrzej Stuczyński
2023-10-31 16:28:55 +00:00
parent caf055efc1
commit b40736d46b
5 changed files with 72 additions and 0 deletions
Generated
+9
View File
@@ -7594,6 +7594,15 @@ dependencies = [
"x25519-dalek 2.0.0",
]
[[package]]
name = "nymvisor"
version = "0.1.0"
dependencies = [
"clap 4.4.7",
"lazy_static",
"nym-bin-common",
]
[[package]]
name = "object"
version = "0.32.1"
+1
View File
@@ -105,6 +105,7 @@ members = [
"tools/internal/sdk-version-bump",
"tools/nym-cli",
"tools/nym-nr-query",
"tools/nymvisor",
"tools/ts-rs-cli",
"wasm/client",
# "wasm/full-nym-wasm",
+17
View File
@@ -0,0 +1,17 @@
[package]
name = "nymvisor"
version = "0.1.0"
authors.workspace = true
repository.workspace = true
homepage.workspace = true
documentation.workspace = true
edition.workspace = true
license.workspace = true
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
clap = { workspace = true, features = ["derive"] }
lazy_static = { workspace = true }
nym-bin-common = { path = "../../common/bin-common"}
+33
View File
@@ -0,0 +1,33 @@
// Copyright 2023 - Nym Technologies SA <contact@nymtech.net>
// SPDX-License-Identifier: Apache-2.0
use clap::{Parser, Subcommand};
use lazy_static::lazy_static;
use nym_bin_common::bin_info;
lazy_static! {
pub static ref PRETTY_BUILD_INFORMATION: String = bin_info!().pretty_print();
}
// Helper for passing LONG_VERSION to clap
fn pretty_build_info_static() -> &'static str {
&PRETTY_BUILD_INFORMATION
}
#[derive(Parser, Debug)]
#[clap(author = "Nymtech", version, long_version = pretty_build_info_static(), about)]
pub(crate) struct Cli {
// I doubt we're gonna need any global flags here, but I'm going to leave the the option open
// so that'd be easier to add them later if needed
#[clap(subcommand)]
command: Commands,
}
#[derive(Subcommand, Debug)]
pub(crate) enum Commands {
Init,
Run,
BuildInfo,
AddUpgrade,
Config,
}
+12
View File
@@ -0,0 +1,12 @@
// Copyright 2023 - Nym Technologies SA <contact@nymtech.net>
// SPDX-License-Identifier: Apache-2.0
use crate::cli::Cli;
use clap::Parser;
pub(crate) mod cli;
fn main() {
let args = Cli::parse();
println!("{args:#?}");
}