feat: v0.7.0, add direct decrypt

This commit is contained in:
2023-10-29 00:38:00 +08:00
parent fa5d01a7d5
commit 9e46d11e89
6 changed files with 131 additions and 4 deletions

View File

@@ -3,7 +3,7 @@ extern crate core;
use clap::{Parser, Subcommand};
use rust_util::XResult;
use tiny_encrypt::{CmdConfig, CmdDecrypt, CmdEncrypt, CmdInfo, CmdVersion};
use tiny_encrypt::{CmdConfig, CmdDecrypt, CmdDirectDecrypt, CmdEncrypt, CmdInfo, CmdVersion};
#[derive(Debug, Parser)]
#[command(name = "tiny-encrypt-rs")]
@@ -21,6 +21,9 @@ enum Commands {
/// Decrypt file(s)
#[command(arg_required_else_help = true, short_flag = 'd')]
Decrypt(CmdDecrypt),
/// Direct decrypt file(s)
#[command(arg_required_else_help = true)]
DirectDecrypt(CmdDirectDecrypt),
/// Show file info
#[command(arg_required_else_help = true, short_flag = 'I')]
Info(CmdInfo),
@@ -37,6 +40,7 @@ fn main() -> XResult<()> {
match args.command {
Commands::Encrypt(cmd_encrypt) => tiny_encrypt::encrypt(cmd_encrypt),
Commands::Decrypt(cmd_decrypt) => tiny_encrypt::decrypt(cmd_decrypt),
Commands::DirectDecrypt(cmd_direct_decrypt) => tiny_encrypt::direct_decrypt(cmd_direct_decrypt),
Commands::Info(cmd_info) => tiny_encrypt::info(cmd_info),
Commands::Version(cmd_version) => tiny_encrypt::version(cmd_version),
Commands::Config(cmd_config) => tiny_encrypt::config(cmd_config),