keys import (#1240)

* pattern importing

* tests for import

* cli options for account import

* [options] for import also

* removed globbing

* removed glob crate refs
This commit is contained in:
Nikolay Volf
2016-06-08 17:17:37 +04:00
committed by Gav Wood
parent be435cde99
commit b4b883b341
6 changed files with 122 additions and 5 deletions

View File

@@ -23,7 +23,8 @@ Parity. Ethereum Client.
Usage:
parity daemon <pid-file> [options]
parity account (new | list) [options]
parity account (new | list ) [options]
parity account import <path>... [options]
parity import [ <file> ] [options]
parity export [ <file> ] [options]
parity signer new-token [options]
@@ -212,6 +213,7 @@ pub struct Args {
pub cmd_new_token: bool,
pub arg_pid_file: String,
pub arg_file: Option<String>,
pub arg_path: Vec<String>,
pub flag_chain: String,
pub flag_db_path: String,
pub flag_identity: String,

View File

@@ -482,6 +482,11 @@ fn execute_account_cli(conf: Configuration) {
for &(addr, _) in &secret_store.accounts().unwrap() {
println!("{:?}", addr);
}
return;
}
if conf.args.cmd_import {
let imported = util::keys::import_keys_paths(&mut secret_store, &conf.args.arg_path).unwrap();
println!("Imported {} keys", imported);
}
}