add opt.rs

This commit is contained in:
2019-11-30 10:43:58 +08:00
parent 305aa12584
commit 93e24e3b08
2 changed files with 48 additions and 0 deletions

View File

@@ -2,19 +2,30 @@ extern crate sequoia_openpgp as openpgp;
pub mod oss_util;
pub mod pgp_util;
pub mod config_util;
pub mod opt;
use std::{
time::SystemTime,
};
use rust_util::{
XResult,
util_msg::*,
};
use config_util::*;
// use pgp_util::OpenPGPTool;
use opt::{
Options,
};
// https://docs.sequoia-pgp.org/sequoia_openpgp/serialize/stream/struct.Encryptor.html
// https://gitlab.com/sequoia-pgp/sequoia/blob/master/openpgp/examples/generate-encrypt-decrypt.rs
fn main() -> XResult<()> {
let options = Options::new_and_parse_args()?;
if options.version {
print_message(MessageType::INFO, "VERSION!!!");
return Ok(());
}
println!("Hello, world!");
println!("{}", SystemTime::now().duration_since(SystemTime::UNIX_EPOCH).unwrap().as_secs());