mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 10:31:03 +00:00
Splitting relaychain and parachain command-line arguments (#42)
Fixes #34 Added .editorconfig
This commit is contained in:
@@ -19,6 +19,7 @@
|
||||
#![warn(missing_docs)]
|
||||
#![warn(unused_extern_crates)]
|
||||
|
||||
use itertools::Itertools;
|
||||
use polkadot_primitives::parachain::Id as ParaId;
|
||||
|
||||
mod chain_spec;
|
||||
@@ -30,17 +31,28 @@ pub use sc_cli::{error, IntoExit, VersionInfo};
|
||||
|
||||
/// The parachain id of this parachain.
|
||||
pub const PARA_ID: ParaId = ParaId::new(100);
|
||||
const EXECUTABLE_NAME: &'static str = "cumulus-test-parachain-collator";
|
||||
const DESCRIPTION: &'static str =
|
||||
"Cumulus test parachain collator\n\nThe command-line arguments provided first will be \
|
||||
passed to the parachain node, while the arguments provided after -- will be passed \
|
||||
to the relaychain node.\n\n\
|
||||
cumulus-test-parachain-collator [parachain-args] -- [relaychain-args]";
|
||||
|
||||
fn main() -> Result<(), cli::error::Error> {
|
||||
let version = VersionInfo {
|
||||
name: "Cumulus Test Parachain Collator",
|
||||
commit: env!("VERGEN_SHA_SHORT"),
|
||||
version: env!("CARGO_PKG_VERSION"),
|
||||
executable_name: "cumulus-test-parachain-collator",
|
||||
author: "Parity Technologies <admin@parity.io>",
|
||||
description: "Cumulus test parachain collator",
|
||||
description: DESCRIPTION,
|
||||
executable_name: EXECUTABLE_NAME,
|
||||
support_url: "https://github.com/paritytech/cumulus/issues/new",
|
||||
};
|
||||
|
||||
cli::run(std::env::args(), cli::Exit, version)
|
||||
let args = std::env::args().collect::<Vec<String>>();
|
||||
let mut iter = args.iter();
|
||||
let parachain_args: Vec<_> = iter.take_while_ref(|&x| x != &"--").collect();
|
||||
let relaychain_args: Vec<_> = iter.collect();
|
||||
|
||||
cli::run(parachain_args, relaychain_args, cli::Exit, version)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user