use clap3 instead of structopt (#10632)

* use clap3 instead of structopt

Signed-off-by: koushiro <koushiro.cqx@gmail.com>

* format

Signed-off-by: koushiro <koushiro.cqx@gmail.com>

* update ss58-registry and revert some nits

Signed-off-by: koushiro <koushiro.cqx@gmail.com>

* Fix clippy and doc

Signed-off-by: koushiro <koushiro.cqx@gmail.com>

* update clap to 3.0.7

Signed-off-by: koushiro <koushiro.cqx@gmail.com>

* Apply review suggestions

Signed-off-by: koushiro <koushiro.cqx@gmail.com>

* remove useless option long name

Signed-off-by: koushiro <koushiro.cqx@gmail.com>

* cargo fmt

Signed-off-by: koushiro <koushiro.cqx@gmail.com>
This commit is contained in:
Qinxuan Chen
2022-01-25 00:28:46 +08:00
committed by GitHub
parent d1ff02d31e
commit e327b734bc
66 changed files with 660 additions and 768 deletions
@@ -17,23 +17,23 @@
// along with this program. If not, see <https://www.gnu.org/licenses/>.
use crate::error;
use clap::Args;
use sc_service::{KeepBlocks, PruningMode, Role};
use structopt::StructOpt;
/// Parameters to define the pruning mode
#[derive(Debug, StructOpt, Clone)]
#[derive(Debug, Clone, Args)]
pub struct PruningParams {
/// Specify the state pruning mode, a number of blocks to keep or 'archive'.
///
/// Default is to keep all block states if the node is running as a
/// validator (i.e. 'archive'), otherwise state is only kept for the last
/// 256 blocks.
#[structopt(long = "pruning", value_name = "PRUNING_MODE")]
#[clap(long, value_name = "PRUNING_MODE")]
pub pruning: Option<String>,
/// Specify the number of finalized blocks to keep in the database.
///
/// Default is to keep all blocks.
#[structopt(long, value_name = "COUNT")]
#[clap(long, value_name = "COUNT")]
pub keep_blocks: Option<u32>,
}