add read config

This commit is contained in:
2019-12-14 23:35:52 +08:00
parent 795ff60e3e
commit 44fb8683b2

View File

@@ -29,6 +29,10 @@ fn main() -> XResult<()> {
return Ok(());
}
if options.verbose {
print_message(MessageType::DEBUG, &format!("Config is: {}", &options.config));
}
println!("Hello, world!");
println!("{}", SystemTime::now().duration_since(SystemTime::UNIX_EPOCH).unwrap().as_secs());
@@ -44,7 +48,13 @@ fn main() -> XResult<()> {
// let openpgp_client = OpenPGPTool::from_file("sample.gpg")?;
// openpgp_client.encrypt_file("a", "b.asc", true)?;
let config_json = get_config_json(None); // TODO
let config_json = get_config_json(if options.config == "" { None } else { Some(&options.config) });
if config_json.is_none() {
return Ok(());
}
// TODO ...
// let j = config_json.unwrap();
// println!("{}", j);