feat: code style
This commit is contained in:
@@ -48,9 +48,6 @@ use crate::wrap_key::WrapKey;
|
||||
|
||||
#[derive(Debug, Args)]
|
||||
pub struct CmdDecrypt {
|
||||
/// Files need to be decrypted
|
||||
pub paths: Vec<PathBuf>,
|
||||
|
||||
/// PGP or PIV PIN
|
||||
#[arg(long, short = 'p')]
|
||||
pub pin: Option<String>,
|
||||
@@ -94,6 +91,9 @@ pub struct CmdDecrypt {
|
||||
/// Digest algorithm (sha1, sha256[default], sha384, sha512 ...)
|
||||
#[arg(long, short = 'A')]
|
||||
pub digest_algorithm: Option<String>,
|
||||
|
||||
/// Files need to be decrypted
|
||||
pub paths: Vec<PathBuf>,
|
||||
}
|
||||
|
||||
impl Drop for CmdDecrypt {
|
||||
|
||||
@@ -34,9 +34,6 @@ use crate::wrap_key::{WrapKey, WrapKeyHeader};
|
||||
|
||||
#[derive(Debug, Args)]
|
||||
pub struct CmdEncrypt {
|
||||
/// Files need to be decrypted
|
||||
pub paths: Vec<PathBuf>,
|
||||
|
||||
/// Plaintext comment
|
||||
#[arg(long, short = 'c')]
|
||||
pub comment: Option<String>,
|
||||
@@ -76,6 +73,9 @@ pub struct CmdEncrypt {
|
||||
/// Encryption algorithm (AES/GCM, CHACHA20/POLY1305 or AES, CHACHA20, default AES/GCM)
|
||||
#[arg(long, short = 'A')]
|
||||
pub encryption_algorithm: Option<String>,
|
||||
|
||||
/// Files need to be decrypted
|
||||
pub paths: Vec<PathBuf>,
|
||||
}
|
||||
|
||||
pub fn encrypt(cmd_encrypt: CmdEncrypt) -> XResult<()> {
|
||||
|
||||
@@ -176,10 +176,7 @@ pub fn read_number(hint: &str, from: usize, to: usize) -> usize {
|
||||
}
|
||||
|
||||
pub fn get_user_agent() -> String {
|
||||
format!("TinyEncrypt-rs v{}@{}-{}",
|
||||
env!("CARGO_PKG_VERSION"),
|
||||
get_os(), get_arch(),
|
||||
)
|
||||
format!("TinyEncrypt-rs v{}@{}-{}", env!("CARGO_PKG_VERSION"), get_os(), get_arch())
|
||||
}
|
||||
|
||||
pub fn get_os() -> String {
|
||||
|
||||
Reference in New Issue
Block a user