diff --git a/src/cmd_decrypt.rs b/src/cmd_decrypt.rs index ff69b6e..3fd80b1 100644 --- a/src/cmd_decrypt.rs +++ b/src/cmd_decrypt.rs @@ -38,6 +38,7 @@ use crate::util_digest::DigestWrite; use crate::util_keychainkey; #[cfg(feature = "macos")] use crate::util_keychainstatic; +#[cfg(feature = "macos")] use crate::util_keychainstatic::KeychainKey; use crate::util_progress::Progress; use crate::wrap_key::WrapKey; @@ -46,36 +47,47 @@ use crate::wrap_key::WrapKey; pub struct CmdDecrypt { /// Files need to be decrypted pub paths: Vec, + /// PGP or PIV PIN #[arg(long, short = 'p')] pub pin: Option, + /// KeyID #[arg(long, short = 'k')] pub key_id: Option, + /// PIV slot #[arg(long, short = 's')] pub slot: Option, + /// Remove source file #[arg(long, short = 'R')] pub remove_file: bool, + /// Skip decrypt file #[arg(long, short = 'S')] pub skip_decrypt_file: bool, + /// Direct print to the console, file must less than 10K #[arg(long, short = 'P')] pub direct_print: bool, + /// Split std out and std err #[arg(long)] pub split_print: bool, + /// Digest file #[arg(long, short = 'D')] pub digest_file: bool, + /// Edit file #[arg(long, short = 'E')] pub edit_file: bool, + /// Readonly mode #[arg(long)] pub readonly: bool, + /// Digest algorithm (sha1, sha256[default], sha384, sha512 ...) #[arg(long, short = 'A')] pub digest_algorithm: Option, diff --git a/src/cmd_directdecrypt.rs b/src/cmd_directdecrypt.rs index bc0ddb7..4550447 100644 --- a/src/cmd_directdecrypt.rs +++ b/src/cmd_directdecrypt.rs @@ -17,12 +17,15 @@ pub struct CmdDirectDecrypt { /// File input #[arg(long, short = 'i')] pub file_in: PathBuf, + /// File output #[arg(long, short = 'o')] pub file_out: PathBuf, + /// Remove source file #[arg(long, short = 'R')] pub remove_file: bool, + /// Key in HEX (32 bytes) #[arg(long, short = 'k')] pub key: String, diff --git a/src/cmd_encrypt.rs b/src/cmd_encrypt.rs index ea4c8ff..5a92e31 100644 --- a/src/cmd_encrypt.rs +++ b/src/cmd_encrypt.rs @@ -28,33 +28,43 @@ use crate::wrap_key::{WrapKey, WrapKeyHeader}; pub struct CmdEncrypt { /// Files need to be decrypted pub paths: Vec, + /// Plaintext comment #[arg(long, short = 'c')] pub comment: Option, + /// Encrypted comment #[arg(long, short = 'C')] pub encrypted_comment: Option, + /// Encryption profile (use default when --key-filter is assigned) #[arg(long, short = 'p')] pub profile: Option, + /// Encryption key filter (key_id or type:TYPE(e.g. ecdh, pgp, ecdh-p384, pgp-ed25519), multiple joined by ',', ALL for all) #[arg(long, short = 'k')] pub key_filter: Option, + /// Compress before encrypt #[arg(long, short = 'x')] pub compress: bool, + /// Compress level (from 0[none], 1[fast] .. 6[default] .. to 9[best]) #[arg(long, short = 'L')] pub compress_level: Option, + /// Remove source file #[arg(long, short = 'R')] pub remove_file: bool, + /// Create file (create a empty encrypted file) #[arg(long, short = 'a')] pub create: bool, + /// Disable compress meta #[arg(long)] pub disable_compress_meta: bool, + /// Encryption algorithm (AES/GCM, CHACHA20/POLY1305 or AES, CHACHA20, default AES/GCM) #[arg(long, short = 'A')] pub encryption_algorithm: Option, diff --git a/src/cmd_execenv.rs b/src/cmd_execenv.rs index 7a7aec9..15c64c1 100644 --- a/src/cmd_execenv.rs +++ b/src/cmd_execenv.rs @@ -21,14 +21,18 @@ pub struct CmdExecEnv { /// PGP or PIV PIN #[arg(long, short = 'p')] pub pin: Option, + /// KeyID #[arg(long, short = 'k')] pub key_id: Option, + /// PIV slot #[arg(long, short = 's')] pub slot: Option, + /// Tiny encrypt file name pub file_name: String, + /// Command and arguments pub command_arguments: Vec, } diff --git a/src/cmd_info.rs b/src/cmd_info.rs index 1f2ae62..9d07159 100644 --- a/src/cmd_info.rs +++ b/src/cmd_info.rs @@ -18,11 +18,12 @@ use crate::wrap_key::WrapKey; #[derive(Debug, Args)] pub struct CmdInfo { - /// File - pub paths: Vec, /// Show raw meta #[arg(long, short = 'M', default_value_t = false)] pub raw_meta: bool, + + /// File + pub paths: Vec, } pub fn info(cmd_info: CmdInfo) -> XResult<()> {