chore(cli): make cli display docs correctly (#14017)

* chore(cli): make cli display docs correctly

* ".git/.scripts/commands/fmt/fmt.sh"

---------

Co-authored-by: command-bot <>
This commit is contained in:
yjh
2023-04-27 18:34:15 +08:00
committed by GitHub
parent ac6e43e628
commit 31e1329da0
17 changed files with 8 additions and 94 deletions
@@ -38,7 +38,6 @@ pub struct BuildSpecCmd {
pub raw: bool,
/// Disable adding the default bootnode to the specification.
///
/// By default the `/ip4/127.0.0.1/tcp/30333/p2p/NODE_PEER_ID` bootnode is added to the
/// specification when no bootnode exists.
#[arg(long)]
@@ -29,12 +29,11 @@ use std::{fmt::Debug, str::FromStr, sync::Arc};
/// The `check-block` command used to validate blocks.
#[derive(Debug, Clone, Parser)]
pub struct CheckBlockCmd {
/// Block hash or number
/// Block hash or number.
#[arg(value_name = "HASH or NUMBER")]
pub input: BlockNumberOrHash,
/// The default number of 64KB pages to ever allocate for Wasm execution.
///
/// Don't alter this unless you know what you're doing.
#[arg(long, value_name = "COUNT")]
pub default_heap_pages: Option<u32>,
@@ -36,13 +36,11 @@ pub struct ExportBlocksCmd {
pub output: Option<PathBuf>,
/// Specify starting block number.
///
/// Default is 1.
#[arg(long, value_name = "BLOCK")]
pub from: Option<GenericNumber>,
/// Specify last block number.
///
/// Default is best block.
#[arg(long, value_name = "BLOCK")]
pub to: Option<GenericNumber>,
@@ -35,13 +35,11 @@ use std::{
)]
pub struct GenerateNodeKeyCmd {
/// Name of file to save secret key to.
///
/// If not given, the secret key is printed to stdout.
#[arg(long)]
file: Option<PathBuf>,
/// The output is in raw binary format.
///
/// If not given, the output is written as an hex encoded string.
#[arg(long)]
bin: bool,
@@ -41,7 +41,6 @@ pub struct ImportBlocksCmd {
pub input: Option<PathBuf>,
/// The default number of 64KB pages to ever allocate for Wasm execution.
///
/// Don't alter this unless you know what you're doing.
#[arg(long, value_name = "COUNT")]
pub default_heap_pages: Option<u32>,
@@ -36,7 +36,7 @@ pub struct InsertKeyCmd {
#[arg(long)]
suri: Option<String>,
/// Key type, examples: "gran", or "imon"
/// Key type, examples: "gran", or "imon".
#[arg(long)]
key_type: String,
@@ -34,12 +34,9 @@ use std::str::FromStr;
pub struct InspectKeyCmd {
/// A Key URI to be inspected. May be a secret seed, secret URI
/// (with derivation paths and password), SS58, public URI or a hex encoded public key.
///
/// If it is a hex encoded public key, `--public` needs to be given as argument.
///
/// If the given value is a file, the file content will be used
/// as URI.
///
/// If omitted, you will be prompted for the URI.
uri: Option<String>,
@@ -64,12 +61,10 @@ pub struct InspectKeyCmd {
pub crypto_scheme: CryptoSchemeFlag,
/// Expect that `--uri` has the given public key/account-id.
///
/// If `--uri` has any derivations, the public key is checked against the base `uri`, i.e. the
/// `uri` without any derivation applied. However, if `uri` has a password or there is one
/// given by `--password`, it will be used to decrypt `uri` before comparing the public
/// key/account-id.
///
/// If there is no derivation in `--uri`, the public key will be checked against the public key
/// of `--uri` directly.
#[arg(long, conflicts_with = "public")]
@@ -34,13 +34,11 @@ use std::{
)]
pub struct InspectNodeKeyCmd {
/// Name of file to read the secret key from.
///
/// If not given, the secret key is read from stdin (up to EOF).
#[arg(long)]
file: Option<PathBuf>,
/// The input is in raw binary format.
///
/// If not given, the input is read as an hex encoded string.
#[arg(long)]
bin: bool,
@@ -38,7 +38,6 @@ use std::net::{IpAddr, Ipv4Addr, SocketAddr};
#[derive(Debug, Clone, Parser)]
pub struct RunCmd {
/// Enable validator mode.
///
/// The node will be started with the authority role and actively
/// participate in any consensus task that it can (e.g. depending on
/// availability of local keys).
@@ -51,7 +50,6 @@ pub struct RunCmd {
pub no_grandpa: bool,
/// Listen to all RPC interfaces.
///
/// 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://docs.substrate.io/main-docs/build/custom-rpc/#public-rpcs>.
@@ -60,13 +58,11 @@ pub struct RunCmd {
pub rpc_external: bool,
/// Listen to all RPC interfaces.
///
/// Same as `--rpc-external`.
#[arg(long)]
pub unsafe_rpc_external: bool,
/// RPC methods to expose.
///
/// - `unsafe`: Exposes every RPC method.
/// - `safe`: Exposes only a safe subset of RPC methods, denying unsafe RPC methods.
/// - `auto`: Acts as `safe` if RPC is served externally, e.g. when `--{rpc,ws}-external` is
@@ -82,7 +78,6 @@ pub struct RunCmd {
pub rpc_methods: RpcMethods,
/// Listen to all Websocket interfaces.
///
/// 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://docs.substrate.io/main-docs/build/custom-rpc/#public-rpcs>.
@@ -91,7 +86,6 @@ pub struct RunCmd {
pub ws_external: bool,
/// Listen to all Websocket interfaces.
///
/// Same as `--ws-external` but doesn't warn you about it.
#[arg(long)]
pub unsafe_ws_external: bool,
@@ -137,7 +131,6 @@ pub struct RunCmd {
pub ws_max_out_buffer_capacity: Option<usize>,
/// Specify browser Origins allowed to access the HTTP & WS RPC servers.
///
/// A comma-separated list of origins (protocol://domain or special `null`
/// value). Value of `all` will disable origin validation. Default is to
/// allow localhost and <https://polkadot.js.org> origins. When running in
@@ -146,7 +139,6 @@ pub struct RunCmd {
pub rpc_cors: Option<Cors>,
/// The human-readable name for this node.
///
/// It's used as network node name.
#[arg(long, value_name = "NAME")]
pub name: Option<String>,
@@ -225,13 +217,10 @@ pub struct RunCmd {
pub force_authoring: bool,
/// Run a temporary node.
///
/// A temporary directory will be created to store the configuration and will be deleted
/// at the end of the process.
///
/// Note: the directory is random per process execution. This directory is used as base path
/// which includes: database, node key and keystore.
///
/// When `--dev` is given and no explicit `--base-path`, this option is implied.
#[arg(long, conflicts_with = "base_path")]
pub tmp: bool,