tla 0.1.12

A CLI tool for compressing and encrypting a file or a directory. (tar, lzma, aes & des)
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use aoko::{standard::functions::fun::{measure_time_with_value, time_conversion_with_unit}, no_std::{pipelines::pipe::Pipe, algebraic::sum::TimeUnit}};
use tla::{cli::get_args, compress_and_encrypt, decrypt_and_decompress};
use std::time::Duration;

fn tla() -> (impl FnOnce(Duration) -> u128, TimeUnit) {
    let (r#in, aes_key, des_key, ce, unit) = get_args().pipe(|s| (s.input, s.aes_key, s.des_key, s.ce, s.time));
    if ce { compress_and_encrypt(&r#in, &aes_key, &des_key) }
    else { decrypt_and_decompress(&r#in, &aes_key, &des_key) }
    time_conversion_with_unit(unit)
}

fn main() {
    measure_time_with_value(tla)
        .pipe(|(e, (f, u))| println!("Execution time: {} {u:?}.", f(e)));
}