Simplier and cleaner implementation of #1468 (#1471)

* Simplier and cleaner implementation of #1468

* move AppInfo into base_path

* default to executable_name rather than pretty visible name
This commit is contained in:
Benjamin Kampmann
2019-01-17 22:26:58 +01:00
committed by Gav Wood
parent a7a0121b09
commit d4eb3872a0
5 changed files with 19 additions and 24 deletions
+4 -12
View File
@@ -20,7 +20,6 @@
#![warn(unused_extern_crates)]
extern crate tokio;
extern crate app_dirs;
extern crate substrate_cli as cli;
extern crate substrate_primitives as primitives;
@@ -58,13 +57,6 @@ use substrate_service::{ServiceFactory, Roles as ServiceRoles};
use params::{Params as NodeParams};
use structopt::StructOpt;
use std::ops::Deref;
use app_dirs::AppInfo;
const APP_INFO: AppInfo = AppInfo {
name: "Substrate Node",
author: "Parity Technologies"
};
/// The chain specification option.
#[derive(Clone, Debug)]
@@ -130,15 +122,15 @@ pub fn run<I, T, E>(args: I, exit: E, version: cli::VersionInfo) -> error::Resul
};
let (spec, config) = cli::parse_matches::<service::Factory, _>(
load_spec, version, "substrate-node", &matches, &APP_INFO
load_spec, &version, "substrate-node", &matches
)?;
match cli::execute_default::<service::Factory, _>(spec, exit, &matches, &config, &APP_INFO)? {
match cli::execute_default::<service::Factory, _>(spec, exit, &matches, &config, &version)? {
cli::Action::ExecutedInternally => (),
cli::Action::RunService(exit) => {
info!("{}", APP_INFO.name);
info!("{}", version.name);
info!(" version {}", config.full_version());
info!(" by {}, 2017, 2018", APP_INFO.author);
info!(" by {}, 2017, 2018", version.author);
info!("Chain specification: {}", config.chain_spec.name());
info!("Node name: {}", config.name);
info!("Roles: {:?}", config.roles);