Minor fixes to CLI arg docs (#5339)

* minor fixes to CLI arg docs

* Update client/cli/src/params/shared_params.rs

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
This commit is contained in:
joe petrowski
2020-03-21 08:52:57 +01:00
committed by GitHub
parent 71aef91099
commit 40f57f8ffa
6 changed files with 25 additions and 22 deletions
+4 -4
View File
@@ -50,7 +50,7 @@ const DEFAULT_NETWORK_CONFIG_PATH : &'static str = "network";
/// `Run` are exported as main executable parameters. /// `Run` are exported as main executable parameters.
#[derive(Debug, Clone, StructOpt)] #[derive(Debug, Clone, StructOpt)]
pub enum Subcommand { pub enum Subcommand {
/// Build a spec.json file, outputing to stdout. /// Build a spec.json file, outputs to stdout.
BuildSpec(build_spec_cmd::BuildSpecCmd), BuildSpec(build_spec_cmd::BuildSpecCmd),
/// Export blocks to a file. /// Export blocks to a file.
@@ -70,7 +70,7 @@ pub enum Subcommand {
} }
impl Subcommand { impl Subcommand {
/// Get the shared parameters of a `CoreParams` command /// Get the shared parameters of a `CoreParams` command.
pub fn get_shared_params(&self) -> &SharedParams { pub fn get_shared_params(&self) -> &SharedParams {
use Subcommand::*; use Subcommand::*;
@@ -84,7 +84,7 @@ impl Subcommand {
} }
} }
/// Run any `CoreParams` command /// Run any `CoreParams` command.
pub fn run<B, BC, BB>( pub fn run<B, BC, BB>(
self, self,
config: Configuration, config: Configuration,
@@ -107,7 +107,7 @@ impl Subcommand {
} }
} }
/// Update and prepare a `Configuration` with command line parameters /// Update and prepare a `Configuration` with command line parameters.
pub fn update_config<F>( pub fn update_config<F>(
&self, &self,
mut config: &mut Configuration, mut config: &mut Configuration,
+10 -10
View File
@@ -82,7 +82,7 @@ pub struct RunCmd {
)] )]
pub sentry: bool, pub sentry: bool,
/// Disable GRANDPA voter when running in validator mode, otherwise disables the GRANDPA observer. /// Disable GRANDPA voter when running in validator mode, otherwise disable the GRANDPA observer.
#[structopt(long = "no-grandpa")] #[structopt(long = "no-grandpa")]
pub no_grandpa: bool, pub no_grandpa: bool,
@@ -92,7 +92,7 @@ pub struct RunCmd {
/// Listen to all RPC interfaces. /// Listen to all RPC interfaces.
/// ///
/// Default is local. Note: not all RPC methods are safe to be exposed publicly. Use a RPC proxy /// Default is local. Note: not all RPC methods are safe to be exposed publicly. Use an RPC proxy
/// server to filter out dangerous methods. More details: https://github.com/paritytech/substrate/wiki/Public-RPC. /// server to filter out dangerous methods. More details: https://github.com/paritytech/substrate/wiki/Public-RPC.
/// Use `--unsafe-rpc-external` to suppress the warning if you understand the risks. /// Use `--unsafe-rpc-external` to suppress the warning if you understand the risks.
#[structopt(long = "rpc-external")] #[structopt(long = "rpc-external")]
@@ -106,7 +106,7 @@ pub struct RunCmd {
/// Listen to all Websocket interfaces. /// Listen to all Websocket interfaces.
/// ///
/// Default is local. Note: not all RPC methods are safe to be exposed publicly. Use a RPC proxy /// Default is local. Note: not all RPC methods are safe to be exposed publicly. Use an RPC proxy
/// server to filter out dangerous methods. More details: https://github.com/paritytech/substrate/wiki/Public-RPC. /// server to filter out dangerous methods. More details: https://github.com/paritytech/substrate/wiki/Public-RPC.
/// Use `--unsafe-ws-external` to suppress the warning if you understand the risks. /// Use `--unsafe-ws-external` to suppress the warning if you understand the risks.
#[structopt(long = "ws-external")] #[structopt(long = "ws-external")]
@@ -169,7 +169,7 @@ pub struct RunCmd {
/// The URL of the telemetry server to connect to. /// The URL of the telemetry server to connect to.
/// ///
/// This flag can be passed multiple times as a mean to specify multiple /// This flag can be passed multiple times as a means to specify multiple
/// telemetry endpoints. Verbosity levels range from 0-9, with 0 denoting /// telemetry endpoints. Verbosity levels range from 0-9, with 0 denoting
/// the least verbosity. If no verbosity level is specified the default is /// the least verbosity. If no verbosity level is specified the default is
/// 0. /// 0.
@@ -275,7 +275,7 @@ pub struct RunCmd {
} }
impl RunCmd { impl RunCmd {
/// Get the `Sr25519Keyring` matching one of the flag /// Get the `Sr25519Keyring` matching one of the flag.
pub fn get_keyring(&self) -> Option<sp_keyring::Sr25519Keyring> { pub fn get_keyring(&self) -> Option<sp_keyring::Sr25519Keyring> {
use sp_keyring::Sr25519Keyring::*; use sp_keyring::Sr25519Keyring::*;
@@ -290,7 +290,7 @@ impl RunCmd {
else { None } else { None }
} }
/// Update and prepare a `Configuration` with command line parameters of `RunCmd` and `VersionInfo` /// Update and prepare a `Configuration` with command line parameters of `RunCmd` and `VersionInfo`.
pub fn update_config<F>( pub fn update_config<F>(
&self, &self,
mut config: &mut Configuration, mut config: &mut Configuration,
@@ -444,7 +444,7 @@ impl RunCmd {
Ok(()) Ok(())
} }
/// Run the command that runs the node /// Run the command that runs the node.
pub fn run<FNL, FNF, SL, SF>( pub fn run<FNL, FNF, SL, SF>(
self, self,
config: Configuration, config: Configuration,
@@ -489,7 +489,7 @@ impl RunCmd {
} }
} }
/// Check whether a node name is considered as valid /// Check whether a node name is considered as valid.
pub fn is_node_name_valid(_name: &str) -> Result<(), &str> { pub fn is_node_name_valid(_name: &str) -> Result<(), &str> {
let name = _name.to_string(); let name = _name.to_string();
if name.chars().count() >= NODE_NAME_MAX_LENGTH { if name.chars().count() >= NODE_NAME_MAX_LENGTH {
@@ -586,7 +586,7 @@ fn parse_telemetry_endpoints(s: &str) -> Result<(String, u8), Box<dyn std::error
/// handling of `structopt`. /// handling of `structopt`.
#[derive(Clone, Debug)] #[derive(Clone, Debug)]
pub enum Cors { pub enum Cors {
/// All hosts allowed /// All hosts allowed.
All, All,
/// Only hosts on the list are allowed. /// Only hosts on the list are allowed.
List(Vec<String>), List(Vec<String>),
@@ -601,7 +601,7 @@ impl From<Cors> for Option<Vec<String>> {
} }
} }
/// Parse cors origins /// Parse cors origins.
fn parse_cors(s: &str) -> Result<Cors, Box<dyn std::error::Error>> { fn parse_cors(s: &str) -> Result<Cors, Box<dyn std::error::Error>> {
let mut is_all = false; let mut is_all = false;
let mut origins = Vec::new(); let mut origins = Vec::new();
@@ -62,11 +62,11 @@ pub struct ImportParams {
#[structopt(long = "state-cache-size", value_name = "Bytes", default_value = "67108864")] #[structopt(long = "state-cache-size", value_name = "Bytes", default_value = "67108864")]
pub state_cache_size: usize, pub state_cache_size: usize,
/// Comma separated list of targets for tracing /// Comma separated list of targets for tracing.
#[structopt(long = "tracing-targets", value_name = "TARGETS")] #[structopt(long = "tracing-targets", value_name = "TARGETS")]
pub tracing_targets: Option<String>, pub tracing_targets: Option<String>,
/// Receiver to process tracing messages /// Receiver to process tracing messages.
#[structopt( #[structopt(
long = "tracing-receiver", long = "tracing-receiver",
value_name = "RECEIVER", value_name = "RECEIVER",
@@ -83,9 +83,9 @@ pub struct NetworkConfigurationParams {
#[structopt(long = "no-mdns")] #[structopt(long = "no-mdns")]
pub no_mdns: bool, pub no_mdns: bool,
/// Maximum number of peers to ask the same blocks in parallel. /// Maximum number of peers from which to ask for the same blocks in parallel.
/// ///
/// This allows downlading announced blocks from multiple peers. Decrease to save /// This allows downloading announced blocks from multiple peers. Decrease to save
/// traffic and risk increased latency. /// traffic and risk increased latency.
#[structopt(long = "max-parallel-downloads", value_name = "COUNT", default_value = "5")] #[structopt(long = "max-parallel-downloads", value_name = "COUNT", default_value = "5")]
pub max_parallel_downloads: u32, pub max_parallel_downloads: u32,
@@ -38,7 +38,7 @@ pub struct NodeKeyParams {
/// `--node-key-type` as follows: /// `--node-key-type` as follows:
/// ///
/// `ed25519`: /// `ed25519`:
/// The value is parsed as a hex-encoded Ed25519 32 bytes secret key, /// The value is parsed as a hex-encoded Ed25519 32 byte secret key,
/// i.e. 64 hex characters. /// i.e. 64 hex characters.
/// ///
/// The value of this option takes precedence over `--node-key-file`. /// The value of this option takes precedence over `--node-key-file`.
@@ -82,7 +82,7 @@ pub struct NodeKeyParams {
/// as follows: /// as follows:
/// ///
/// `ed25519`: /// `ed25519`:
/// The file must contain an unencoded 32 bytes Ed25519 secret key. /// The file must contain an unencoded 32 byte Ed25519 secret key.
/// ///
/// If the file does not exist, it is created with a newly generated secret key of /// If the file does not exist, it is created with a newly generated secret key of
/// the chosen type. /// the chosen type.
@@ -30,7 +30,7 @@ const DEFAULT_DB_CONFIG_PATH : &'static str = "db";
/// Shared parameters used by all `CoreParams`. /// Shared parameters used by all `CoreParams`.
#[derive(Debug, StructOpt, Clone)] #[derive(Debug, StructOpt, Clone)]
pub struct SharedParams { pub struct SharedParams {
/// Specify the chain specification (one of dev, local or staging). /// Specify the chain specification (one of dev, local, or staging).
#[structopt(long = "chain", value_name = "CHAIN_SPEC")] #[structopt(long = "chain", value_name = "CHAIN_SPEC")]
pub chain: Option<String>, pub chain: Option<String>,
@@ -42,7 +42,10 @@ pub struct SharedParams {
#[structopt(long = "base-path", short = "d", value_name = "PATH", parse(from_os_str))] #[structopt(long = "base-path", short = "d", value_name = "PATH", parse(from_os_str))]
pub base_path: Option<PathBuf>, pub base_path: Option<PathBuf>,
/// Sets a custom logging filter. /// Sets a custom logging filter. Syntax is <target>=<level>, e.g. -lsync=debug.
///
/// Log levels (least to most verbose) are error, warn, info, debug, and trace.
/// By default, all targets log `info`. The global log level can be set with -l<level>.
#[structopt(short = "l", long = "log", value_name = "LOG_PATTERN")] #[structopt(short = "l", long = "log", value_name = "LOG_PATTERN")]
pub log: Option<String>, pub log: Option<String>,
} }