From: Riccardo Casatta Date: Tue, 17 Nov 2020 14:08:04 +0000 (+0100) Subject: use proper type for EsploraHeader, make conversion to BlockHeader infallible X-Git-Tag: v0.1.0~31 X-Git-Url: http://internal-gitweb-vhost/script/%22https:/enum.HexToArrayError.html?a=commitdiff_plain;h=25273448fe34993c7758a9ce508ea18bb6b76f9f;p=bdk-cli use proper type for EsploraHeader, make conversion to BlockHeader infallible --- diff --git a/src/cli.rs b/src/cli.rs index de56e87..06c11d4 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -309,56 +309,57 @@ pub fn make_cli_subcommands<'a, 'b>() -> App<'a, 'b> { } pub fn add_global_flags<'a, 'b>(app: App<'a, 'b>) -> App<'a, 'b> { - let mut app = app.arg( - Arg::with_name("network") - .short("n") - .long("network") - .value_name("NETWORK") - .help("Sets the network") - .takes_value(true) - .default_value("testnet") - .possible_values(&["testnet", "regtest"]), - ) - .arg( - Arg::with_name("wallet") - .short("w") - .long("wallet") - .value_name("WALLET_NAME") - .help("Selects the wallet to use") - .takes_value(true) - .default_value("main"), - ) - .arg( - Arg::with_name("proxy") - .short("p") - .long("proxy") - .value_name("SERVER:PORT") - .help("Sets the SOCKS5 proxy for the Electrum client") - .takes_value(true), - ) - .arg( - Arg::with_name("descriptor") - .short("d") - .long("descriptor") - .value_name("DESCRIPTOR") - .help("Sets the descriptor to use for the external addresses") - .required(true) - .takes_value(true), - ) - .arg( - Arg::with_name("change_descriptor") - .short("c") - .long("change_descriptor") - .value_name("DESCRIPTOR") - .help("Sets the descriptor to use for internal addresses") - .takes_value(true), - ) - .arg( - Arg::with_name("v") - .short("v") - .multiple(true) - .help("Sets the level of verbosity"), - ); + let mut app = app + .arg( + Arg::with_name("network") + .short("n") + .long("network") + .value_name("NETWORK") + .help("Sets the network") + .takes_value(true) + .default_value("testnet") + .possible_values(&["testnet", "regtest"]), + ) + .arg( + Arg::with_name("wallet") + .short("w") + .long("wallet") + .value_name("WALLET_NAME") + .help("Selects the wallet to use") + .takes_value(true) + .default_value("main"), + ) + .arg( + Arg::with_name("proxy") + .short("p") + .long("proxy") + .value_name("SERVER:PORT") + .help("Sets the SOCKS5 proxy for the Electrum client") + .takes_value(true), + ) + .arg( + Arg::with_name("descriptor") + .short("d") + .long("descriptor") + .value_name("DESCRIPTOR") + .help("Sets the descriptor to use for the external addresses") + .required(true) + .takes_value(true), + ) + .arg( + Arg::with_name("change_descriptor") + .short("c") + .long("change_descriptor") + .value_name("DESCRIPTOR") + .help("Sets the descriptor to use for internal addresses") + .takes_value(true), + ) + .arg( + Arg::with_name("v") + .short("v") + .multiple(true) + .help("Sets the level of verbosity"), + ); if cfg!(feature = "esplora") { app = app.arg(