Skip to content

Commit

Permalink
deps: update clap to 4
Browse files Browse the repository at this point in the history
Signed-off-by: ljedrz <[email protected]>
  • Loading branch information
ljedrz committed Sep 29, 2022
1 parent fb0b63f commit 8128e1f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ version = "1"
version = "1.0"

[dependencies.clap]
version = "3.2"
version = "4"
features = [ "derive" ]

[dependencies.colored]
Expand Down
23 changes: 15 additions & 8 deletions snarkos/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,22 +42,17 @@ pub struct CLI {
pub beacon: bool,

/// Specify the IP address and port for the node server.
#[clap(parse(try_from_str), default_value = "0.0.0.0:4133", long = "node")]
#[clap(default_value = "0.0.0.0:4133", long = "node")]
pub node: SocketAddr,
/// Specify the IP address and port of a beacon node to connect to.
#[clap(
hide = true,
parse(try_from_str),
default_value = "159.203.77.113:4130",
long = "connect_to_beacon"
)]
#[clap(hide = true, default_value = "159.203.77.113:4130", long = "connect_to_beacon")]
pub beacon_addr: SocketAddr,
/// Specify the IP address and port of a peer to connect to.
#[clap(long = "connect")]
pub connect: Option<String>,

/// Specify the IP address and port for the RPC server.
#[clap(parse(try_from_str), default_value = "0.0.0.0:3033", long = "rpc")]
#[clap(default_value = "0.0.0.0:3033", long = "rpc")]
pub rpc: SocketAddr,
/// Specify the username for the RPC server.
#[clap(default_value = "root", long = "username")]
Expand Down Expand Up @@ -333,3 +328,15 @@ impl NewAccount {
Ok(output)
}
}

#[cfg(test)]
mod tests {
use super::*;

// As per the official clap recommendation.
#[test]
fn verify_cli() {
use clap::CommandFactory;
CLI::command().debug_assert()
}
}

0 comments on commit 8128e1f

Please sign in to comment.