style: format

This commit is contained in:
2021-01-01 22:34:57 +08:00
parent ba35489cdf
commit de0184e253
8 changed files with 20 additions and 2 deletions

View File

@@ -9,12 +9,14 @@ use crate::engine_plugin_credit::CreditContractCreateParameters;
pub struct CommandImpl;
impl Command for CommandImpl {
fn name(&self) -> &str { "create" }
fn subcommand<'a>(&self) -> App<'a, 'a> {
SubCommand::with_name(self.name()).about("Create credit contract subcommand")
.arg(Arg::with_name("name").long("name").short("n").required(true).takes_value(true).help("Contract name"))
.arg(Arg::with_name("limit").long("limit").short("l").required(true).takes_value(true).help("Contract credit limit"))
.arg(Arg::with_name("key").long("key").short("k").required(true).takes_value(true).help("Key pair"))
}
fn run(&self, _arg_matches: &ArgMatches, sub_arg_matches: &ArgMatches) -> CommandError {
let name = sub_arg_matches.value_of("name").unwrap();
let limit = sub_arg_matches.value_of("limit").unwrap();