From 64ed1db60cce8c986ed488da5c1f2683957babfd Mon Sep 17 00:00:00 2001 From: Benjamin Kampmann Date: Fri, 20 Jul 2018 00:43:31 +0200 Subject: [PATCH] Allow bootnodes as IP:PORT, query Peer-id (#386) * Simplify cli parsing: remove unnecessary match for Version and help: e.exit() manages both for us already * Allow passing of IP:PORT as bootnodes, then try to discover its PEER_ID --- polkadot/cli/src/lib.rs | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/polkadot/cli/src/lib.rs b/polkadot/cli/src/lib.rs index 816ec0e758..ea617d4a7b 100644 --- a/polkadot/cli/src/lib.rs +++ b/polkadot/cli/src/lib.rs @@ -171,14 +171,11 @@ pub fn run(args: I, worker: W) -> error::Result<()> where panic_hook::set(); let yaml = load_yaml!("./cli.yml"); - let matches = match clap::App::from_yaml(yaml).version(&(crate_version!().to_owned() + "\n")[..]).get_matches_from_safe(args) { - Ok(m) => m, - Err(ref e) if e.kind == clap::ErrorKind::VersionDisplayed => return Ok(()), - Err(ref e) if e.kind == clap::ErrorKind::HelpDisplayed => { - print!("{}", e); - return Ok(()) - } - Err(e) => e.exit(), + let matches = match clap::App::from_yaml(yaml) + .version(&(crate_version!().to_owned() + "\n")[..]) + .get_matches_from_safe(args) { + Ok(m) => m, + Err(e) => e.exit(), }; // TODO [ToDr] Split parameters parsing from actual execution.