Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
Minor fixes to CLI arg docs (#5339)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
joepetrowski and bkchr committed Mar 21, 2020
1 parent 34c5cb3 commit 93cf07a
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 22 deletions.
8 changes: 4 additions & 4 deletions client/cli/src/commands/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ const DEFAULT_NETWORK_CONFIG_PATH : &'static str = "network";
/// `Run` are exported as main executable parameters.
#[derive(Debug, Clone, StructOpt)]
pub enum Subcommand {
/// Build a spec.json file, outputing to stdout.
/// Build a spec.json file, outputs to stdout.
BuildSpec(build_spec_cmd::BuildSpecCmd),

/// Export blocks to a file.
Expand All @@ -70,7 +70,7 @@ pub enum 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 {
use Subcommand::*;

Expand All @@ -84,7 +84,7 @@ impl Subcommand {
}
}

/// Run any `CoreParams` command
/// Run any `CoreParams` command.
pub fn run<B, BC, BB>(
self,
config: Configuration,
Expand All @@ -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>(
&self,
mut config: &mut Configuration,
Expand Down
20 changes: 10 additions & 10 deletions client/cli/src/commands/runcmd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ pub struct RunCmd {
)]
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")]
pub no_grandpa: bool,

Expand All @@ -92,7 +92,7 @@ pub struct RunCmd {

/// 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.
/// Use `--unsafe-rpc-external` to suppress the warning if you understand the risks.
#[structopt(long = "rpc-external")]
Expand All @@ -106,7 +106,7 @@ pub struct RunCmd {

/// 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.
/// Use `--unsafe-ws-external` to suppress the warning if you understand the risks.
#[structopt(long = "ws-external")]
Expand Down Expand Up @@ -169,7 +169,7 @@ pub struct RunCmd {

/// 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
/// the least verbosity. If no verbosity level is specified the default is
/// 0.
Expand Down Expand Up @@ -275,7 +275,7 @@ pub struct 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> {
use sp_keyring::Sr25519Keyring::*;

Expand All @@ -290,7 +290,7 @@ impl RunCmd {
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>(
&self,
mut config: &mut Configuration,
Expand Down Expand Up @@ -444,7 +444,7 @@ impl RunCmd {
Ok(())
}

/// Run the command that runs the node
/// Run the command that runs the node.
pub fn run<FNL, FNF, SL, SF>(
self,
config: Configuration,
Expand Down Expand Up @@ -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> {
let name = _name.to_string();
if name.chars().count() >= NODE_NAME_MAX_LENGTH {
Expand Down Expand Up @@ -586,7 +586,7 @@ fn parse_telemetry_endpoints(s: &str) -> Result<(String, u8), Box<dyn std::error
/// handling of `structopt`.
#[derive(Clone, Debug)]
pub enum Cors {
/// All hosts allowed
/// All hosts allowed.
All,
/// Only hosts on the list are allowed.
List(Vec<String>),
Expand All @@ -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>> {
let mut is_all = false;
let mut origins = Vec::new();
Expand Down
4 changes: 2 additions & 2 deletions client/cli/src/params/import_params.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,11 @@ pub struct ImportParams {
#[structopt(long = "state-cache-size", value_name = "Bytes", default_value = "67108864")]
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")]
pub tracing_targets: Option<String>,

/// Receiver to process tracing messages
/// Receiver to process tracing messages.
#[structopt(
long = "tracing-receiver",
value_name = "RECEIVER",
Expand Down
4 changes: 2 additions & 2 deletions client/cli/src/params/network_configuration_params.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,9 @@ pub struct NetworkConfigurationParams {
#[structopt(long = "no-mdns")]
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.
#[structopt(long = "max-parallel-downloads", value_name = "COUNT", default_value = "5")]
pub max_parallel_downloads: u32,
Expand Down
4 changes: 2 additions & 2 deletions client/cli/src/params/node_key_params.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ pub struct NodeKeyParams {
/// `--node-key-type` as follows:
///
/// `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.
///
/// The value of this option takes precedence over `--node-key-file`.
Expand Down Expand Up @@ -82,7 +82,7 @@ pub struct NodeKeyParams {
/// as follows:
///
/// `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
/// the chosen type.
Expand Down
7 changes: 5 additions & 2 deletions client/cli/src/params/shared_params.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const DEFAULT_DB_CONFIG_PATH : &'static str = "db";
/// Shared parameters used by all `CoreParams`.
#[derive(Debug, StructOpt, Clone)]
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")]
pub chain: Option<String>,

Expand All @@ -42,7 +42,10 @@ pub struct SharedParams {
#[structopt(long = "base-path", short = "d", value_name = "PATH", parse(from_os_str))]
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")]
pub log: Option<String>,
}
Expand Down

0 comments on commit 93cf07a

Please sign in to comment.