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