feat: rename arg
This commit is contained in:
@@ -34,7 +34,7 @@ pub struct CmdDecrypt {
|
|||||||
pub slot: Option<String>,
|
pub slot: Option<String>,
|
||||||
/// Remove source file
|
/// Remove source file
|
||||||
#[arg(long, short = 'R')]
|
#[arg(long, short = 'R')]
|
||||||
pub remove_source_file: bool,
|
pub remove_file: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn decrypt(cmd_decrypt: CmdDecrypt) -> XResult<()> {
|
pub fn decrypt(cmd_decrypt: CmdDecrypt) -> XResult<()> {
|
||||||
@@ -78,7 +78,7 @@ pub fn decrypt_single(path: &PathBuf, pin: &Option<String>, slot: &Option<String
|
|||||||
util::zeroize(nonce);
|
util::zeroize(nonce);
|
||||||
drop(file_in);
|
drop(file_in);
|
||||||
drop(file_out);
|
drop(file_out);
|
||||||
if cmd_decrypt.remove_source_file {
|
if cmd_decrypt.remove_file {
|
||||||
match fs::remove_file(path) {
|
match fs::remove_file(path) {
|
||||||
Err(e) => warning!("Remove file: {} failed: {}", path_display, e),
|
Err(e) => warning!("Remove file: {} failed: {}", path_display, e),
|
||||||
Ok(_) => information!("Remove file: {} succeed", path_display),
|
Ok(_) => information!("Remove file: {} succeed", path_display),
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ pub struct CmdEncrypt {
|
|||||||
pub compatible_with_1_0: bool,
|
pub compatible_with_1_0: bool,
|
||||||
/// Remove source file
|
/// Remove source file
|
||||||
#[arg(long, short = 'R')]
|
#[arg(long, short = 'R')]
|
||||||
pub remove_source_file: bool,
|
pub remove_file: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn encrypt(cmd_encrypt: CmdEncrypt) -> XResult<()> {
|
pub fn encrypt(cmd_encrypt: CmdEncrypt) -> XResult<()> {
|
||||||
@@ -130,7 +130,7 @@ fn encrypt_single(path: &PathBuf, envelops: &[&TinyEncryptConfigEnvelop], cmd_en
|
|||||||
util::zeroize(nonce);
|
util::zeroize(nonce);
|
||||||
drop(file_in);
|
drop(file_in);
|
||||||
drop(file_out);
|
drop(file_out);
|
||||||
if cmd_encrypt.remove_source_file {
|
if cmd_encrypt.remove_file {
|
||||||
match fs::remove_file(path) {
|
match fs::remove_file(path) {
|
||||||
Err(e) => warning!("Remove file: {} failed: {}", path_display, e),
|
Err(e) => warning!("Remove file: {} failed: {}", path_display, e),
|
||||||
Ok(_) => information!("Remove file: {} succeed", path_display),
|
Ok(_) => information!("Remove file: {} succeed", path_display),
|
||||||
|
|||||||
Reference in New Issue
Block a user