-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Making file config and cli config mutually exclusive
- Loading branch information
1 parent
9be2f43
commit a61822d
Showing
6 changed files
with
172 additions
and
124 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
//! asdfasdf | ||
use clap::{command, Args, Parser}; | ||
use std::path::PathBuf; | ||
|
||
/// Command-line application launching a node executor. | ||
#[derive(Debug, Parser)] | ||
/// asdfasdf | ||
struct Cli { | ||
/// Node configuration. | ||
/// Command line config | ||
/// Full json config | ||
#[arg(long, requires="node_key", conflicts_with_all=["config_file", "validator_key_file", "node_key_file"])] | ||
config: Option<String>, | ||
/// Plain node key | ||
#[arg(long, requires="config", conflicts_with_all=["config_file", "validator_key_file", "node_key_file"])] | ||
node_key: Option<String>, | ||
/// Plain validator key | ||
#[arg(long, conflicts_with_all=["config_file", "validator_key_file", "node_key_file"])] | ||
validator_key: Option<String>, | ||
|
||
/// Path to a validator key file. If set to an empty string, validator key will not be read | ||
/// (i.e., a node will be initialized as a non-validator node). | ||
#[arg(long, default_value = "./validator_key")] | ||
validator_key_file: PathBuf, | ||
/// Path to a JSON file with node configuration. | ||
#[arg(long, default_value = "./config.json")] | ||
config_file: PathBuf, | ||
/// Path to a node key file. | ||
#[arg(long, default_value = "./node_key")] | ||
node_key_file: PathBuf, | ||
|
||
/// Path to the rocksdb database of the node. | ||
#[arg(long, default_value = "./database")] | ||
database: PathBuf, | ||
/// Port for the RPC server. | ||
#[arg(long)] | ||
rpc_port: Option<u16>, | ||
} | ||
|
||
/// adasdsa | ||
#[tokio::main] | ||
/// adasdsa | ||
async fn main() -> anyhow::Result<()> { | ||
let args: Cli = Cli::parse(); | ||
dbg!(args); | ||
Ok(()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.