✨ feat(rules_cli): add option to immediately delete rules
- add `delete` flag to `add` command - allow immediate deletion of rules instead of moving to trash
This commit is contained in:
committed by
Jeremiah Russell
parent
5096fd2b19
commit
0bca3ed6f9
@@ -33,6 +33,9 @@ pub struct AddCli {
|
||||
/// Optional specific label; if not specified one will be generated
|
||||
#[arg(short, long)]
|
||||
label: Option<String>,
|
||||
/// Immediate delete instead of move to trash
|
||||
#[arg(long)]
|
||||
delete: bool,
|
||||
}
|
||||
|
||||
impl AddCli {
|
||||
@@ -41,7 +44,7 @@ impl AddCli {
|
||||
let message_age = MessageAge::new(self.period.to_string().as_str(), self.count);
|
||||
let retention = Retention::new(message_age, generate);
|
||||
|
||||
config.add_rule(retention, self.label.as_ref());
|
||||
config.add_rule(retention, self.label.as_ref(), self.delete);
|
||||
config.save()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user