+ let args: Vec<String> = args().collect();
+
+ if args.iter().any(|arg| arg == "--help") {
+ print_usage();
+ return Ok(());
+ } else if let Some((position_arg_encrypt, _)) = args.iter().find_position(|arg| arg == &"--encrypt") {
+ match args.iter().nth(position_arg_encrypt + 1) {
+ Some(mess_to_encrypt) => {
+ let encrypted_mess = mess_to_encrypt;
+ //let encrypted_mess = crypto::encrypt(key: &str, plain_text: &str);
+ println!("Encrypted message: {}", encrypted_mess);
+ }
+ None => print_usage()
+ }
+
+ return Ok(());
+ }
+
+ println!("Starting RUP as web server...");
+
+ let config: Config = {
+ let f = File::open(consts::FILE_CONF).expect(&format!("Failed to open configuration file {}", consts::FILE_CONF));
+ match from_reader(f) {
+ Ok(c) => c,
+ Err(e) => panic!("Failed to load config: {}", e)
+ }
+ };
+
+ let key = File::open(consts::FILE_KEY).expect(&format!("Failed to open key file: {}", consts::FILE_KEY));
+
+ println!("Configuration: {:?}", config);
+