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,24 +17,24 @@
// along with this program. If not, see <https://www.gnu.org/licenses/>.
use crate::arg_enums::Database;
use clap::Args;
use sc_service::TransactionStorageMode;
use structopt::StructOpt;
/// Parameters for block import.
#[derive(Debug, StructOpt, Clone)]
#[derive(Debug, Clone, Args)]
pub struct DatabaseParams {
/// Select database backend to use.
#[structopt(
#[clap(
long,
alias = "db",
value_name = "DB",
case_insensitive = true,
possible_values = &Database::variants(),
ignore_case = true,
possible_values = Database::variants(),
)]
pub database: Option<Database>,
/// Limit the memory the database cache can use.
#[structopt(long = "db-cache", value_name = "MiB")]
#[clap(long = "db-cache", value_name = "MiB")]
pub database_cache_size: Option<usize>,
/// Enable storage chain mode
@@ -43,7 +43,7 @@ pub struct DatabaseParams {
/// If this is enabled, each transaction is stored separately in the
/// transaction database column and is only referenced by hash
/// in the block body column.
#[structopt(long)]
#[clap(long)]
pub storage_chain: bool,
}