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
This commit is contained in:
Benjamin Kampmann
2018-07-20 00:43:31 +02:00
committed by GitHub
parent e47e946e3a
commit 64ed1db60c
+5 -8
View File
@@ -171,14 +171,11 @@ pub fn run<I, T, W>(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.