pay subcommand now accepts a keypair file for convenience (#6703) (#6706)

(cherry picked from commit a0127e63c6)
This commit is contained in:
mergify[bot]
2019-11-04 14:34:21 -07:00
committed by Michael Vines
parent f4652561d4
commit 3fd09435af

View File

@ -356,7 +356,7 @@ pub fn parse_command(matches: &ArgMatches<'_>) -> Result<CliCommandInfo, Box<dyn
}, },
("pay", Some(matches)) => { ("pay", Some(matches)) => {
let lamports = amount_of(matches, "amount", "unit").expect("Invalid amount"); let lamports = amount_of(matches, "amount", "unit").expect("Invalid amount");
let to = value_of(&matches, "to").unwrap(); let to = pubkey_of(&matches, "to").unwrap();
let timestamp = if matches.is_present("timestamp") { let timestamp = if matches.is_present("timestamp") {
// Parse input for serde_json // Parse input for serde_json
let date_string = if !matches.value_of("timestamp").unwrap().contains('Z') { let date_string = if !matches.value_of("timestamp").unwrap().contains('Z') {
@ -1288,10 +1288,10 @@ pub fn app<'ab, 'v>(name: &str, about: &'ab str, version: &'v str) -> App<'ab, '
.arg( .arg(
Arg::with_name("to") Arg::with_name("to")
.index(1) .index(1)
.value_name("PUBKEY") .value_name("TO PUBKEY")
.takes_value(true) .takes_value(true)
.required(true) .required(true)
.validator(is_pubkey) .validator(is_pubkey_or_keypair)
.help("The pubkey of recipient"), .help("The pubkey of recipient"),
) )
.arg( .arg(