From: FreddieKrugerrand Date: Wed, 1 Feb 2023 20:23:00 +0000 (-0500) Subject: Prompt user to provide at least 2 arguments rather than 3 X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;h=a57de3b45e7497fcdeccfd0f2194ace46c61f34d;p=ldk-sample Prompt user to provide at least 2 arguments rather than 3 env::args returns the name of the binary, which isn't something the end user would think about. So while we require at least 3 arguments, it makes sense to only ask for 2. --- diff --git a/src/args.rs b/src/args.rs index a9d1729..b6ae379 100644 --- a/src/args.rs +++ b/src/args.rs @@ -10,7 +10,7 @@ use std::str::FromStr; pub(crate) fn parse_startup_args() -> Result { if env::args().len() < 3 { - println!("ldk-tutorial-node requires 3 arguments: `cargo run [:@]: ldk_storage_directory_path [] [bitcoin-network] [announced-node-name announced-listen-addr*]`"); + println!("ldk-tutorial-node requires at least 2 arguments: `cargo run [:@]: ldk_storage_directory_path [] [bitcoin-network] [announced-node-name announced-listen-addr*]`"); return Err(()); } let bitcoind_rpc_info = env::args().skip(1).next().unwrap();