Jeremiah Russell
d05f03fc1e
✨ feat(config): add get_rule function to retrieve existing rules
...
- implement get_rule function to fetch rule by id
2025-10-09 09:53:09 +01:00
Jeremiah Russell
ee3c43e54d
🐛 fix(label_cli): display labels by rule id
...
- fix label listing to correctly display labels associated with a specified rule ID
2025-10-09 09:53:09 +01:00
Jerus Bot
1132a2da3c
chore: update prlog for pr
2025-10-09 07:51:29 +01:00
Jeremiah Russell
fb0a3cc640
✨ feat(cli): implement commands dispatching
...
- add logic to dispatch commands to their respective handlers
- implement `run` method to handle different commands
2025-10-09 07:51:29 +01:00
Jerus Bot
01776687fb
chore: update prlog for pr
2025-10-09 07:26:19 +01:00
Jeremiah Russell
4ec18c2712
✨ feat(label_cli): implement remove label subcommand
...
- add `remove` subcommand to the label CLI
- allow users to remove a label from a specific rule by ID
2025-10-09 07:26:19 +01:00
Jeremiah Russell
362ad93adf
✨ feat(label_cli): implement label listing subcommand
...
- add `list` subcommand to `label` subcommand
- implement `run` function for `ListCli` to handle listing labels
2025-10-09 07:26:19 +01:00
Jeremiah Russell
0082b327f7
✨ feat(label): implement add label subcommand
...
- add `add` subcommand to the label cli
- allow users to add labels to existing rules
2025-10-09 07:26:19 +01:00
Jeremiah Russell
06da00ac68
✨ feat(cli): implement label subcommand
...
- adds label subcommand to manage labels associated with rules
- provides list, add, and remove subcommands for label management
2025-10-09 07:26:19 +01:00
Jeremiah Russell
098160ab78
✨ feat(config): add cli config
...
- introduce cli config with clap
- add subcommand rules and label
2025-10-09 07:26:19 +01:00
Jeremiah Russell
cd6858f4bd
♻️ refactor(cli): restructure rules CLI
...
- move rules_cli.rs to config_cli/rules_cli.rs
- remove update command
2025-10-09 07:26:19 +01:00
Jeremiah Russell
7bac3ccd1d
♻️ refactor(cli): rename add_cli to rules_cli
...
- rename `add_cli.rs` to `rules_cli.rs` for better module naming
2025-10-09 07:26:19 +01:00
Jeremiah Russell
50ddb6ab66
♻️ refactor(cli): rename rm_cli to rules_cli
...
- reflect config cli changes
2025-10-09 07:26:19 +01:00
Jeremiah Russell
6f96fbac94
♻️ refactor(cli): consolidate rules and labels under config subcommand
...
- move rules_cli to config_cli
- rename rules subcommand to config
- simplify cli structure for better user experience
2025-10-09 07:26:19 +01:00
Jerus Bot
661aac7d67
chore: Release cull-gmail v0.0.5
2025-10-08 16:40:05 +00:00
Jerus Bot
e6f4bd1398
chore: update prlog for pr
2025-10-08 17:37:49 +01:00
Jeremiah Russell
7b196794b5
🐛 fix(rm_cli): rule removal save
...
- ensure the config is saved after removing a rule by id or label
2025-10-08 17:37:49 +01:00
Jeremiah Russell
0dab9cc427
🐛 fix(config): improve rule removal and logging
...
- fix the logic of `remove_rule_by_label` to check label existence correctly
- change the error returned when label not found to include the label
- add log information when removing rules by id or label
2025-10-08 17:37:49 +01:00
Jeremiah Russell
9e5b0a2cdd
🐛 fix(error): improve error message for missing labels
...
- enhance error message for `LabelNotFoundInRules` to include the missing label
2025-10-08 17:37:49 +01:00
Jerus Bot
3b224f100e
chore: update prlog for pr
2025-10-08 17:17:57 +01:00
Jeremiah Russell
e24d8b1e47
♻️ refactor(config): use string keys for rules in config
...
- changed the type of the key used in the rules BTreeMap from usize to String
- this change makes it easier to serialize and deserialize the configuration
- updated the remove_rule_by_id and remove_rule_by_label functions to use string keys
2025-10-08 17:17:57 +01:00
Jeremiah Russell
6dc425ebec
✨ feat(cli): implement trace logging for configuration
...
- add trace logging to display loaded configuration for debugging
2025-10-08 17:17:57 +01:00
Jerus Bot
66689b795d
chore: update prlog for pr
2025-10-08 16:33:31 +01:00
Jeremiah Russell
572a01e8dd
🐛 fix(error): refine error message for rule selector
...
- clarify that the rule selector can be either --id or --label
2025-10-08 16:33:31 +01:00
Jeremiah Russell
16145f8b22
✨ feat(rules_cli): implement rule removal
...
- add `rm` subcommand to remove rules by id or label
- add `id` and `label` options to `rm` subcommand
- implement `remove_rule_by_id` and `remove_rule_by_label` in `Config`
2025-10-08 16:25:06 +01:00
Jeremiah Russell
6df0ef6536
♻️ refactor(config): enhance EolRule for label management
...
- migrate labels from Vec to BTreeSet for uniqueness and order
- add `remove_label` function to remove specific labels
- change `labels()` function return type from `&Vec<String>` to `Vec<String>`
- implement `Clone` trait for `EolRule`
2025-10-08 16:25:06 +01:00
Jeremiah Russell
80c8bbc863
✨ feat(lib): introduce Result type alias for error handling
...
- add `Result` type alias for cleaner error handling throughout the crate
2025-10-08 16:25:06 +01:00
Jeremiah Russell
3aa76a20a8
✨ feat(error): add custom error types for rule selection
...
- introduce `NoRuleSelector`, `NoRuleFoundForLabel`, and `LabelNotFoundInRules` errors
- these errors provide more specific feedback when rule selection fails
2025-10-08 16:25:06 +01:00
Jeremiah Russell
662d08ba4f
✨ feat(config): enhance rule management and label handling
...
- change rules storage from BTreeMap<String, EolRule> to BTreeMap<usize, EolRule>
- implement functions to remove rules by ID or label
- add helper functions to retrieve labels and rules associated with labels
- improve error handling for missing labels or rules
2025-10-08 16:25:06 +01:00
Jerus Bot
0ba04b2077
chore: update prlog for pr
2025-10-08 16:25:06 +01:00
Jeremiah Russell
0a1187eaf5
✨ feat(rules_cli): implement rm_cli subcommand
...
- add `rm_cli` subcommand structure with clap
- implement basic `run` function for `rm_cli`
2025-10-08 16:25:06 +01:00
Jeremiah Russell
476f5d245e
✨ feat(rules_cli): add remove command to rules cli
...
- add remove command to rules cli
- create rm_cli module
2025-10-08 16:25:06 +01:00
Jerus Bot
aee8f87da3
chore: update prlog for pr
2025-10-08 12:20:34 +01:00
Jeremiah Russell
b47629d076
🐛 fix(eol_rule): correct rule description in to_string method
...
- fix the inaccurate description in the `to_string` method for `EolRule`
- correct the description to properly display that the rule moves the message to trash
2025-10-08 12:20:34 +01:00
Jeremiah Russell
0bca3ed6f9
✨ 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
2025-10-08 12:20:34 +01:00
Jeremiah Russell
5096fd2b19
♻️ refactor(config): rename EolCmd to EolAction for clarity
...
- rename `command` field in `EolRule` to `action`
- update `set_command` method to use `EolAction` enum
- adjust display formatting to reflect the change to "action"
2025-10-08 12:20:34 +01:00
Jeremiah Russell
68b6cba9c1
♻️ refactor(core): rename EolCmd to EolAction
...
- clarifies the purpose as an action to be performed at the end of life
2025-10-08 12:20:34 +01:00
Jeremiah Russell
c81cd6d6cc
✨ feat(config): add delete flag for retention rules
...
- allow retention rules to be configured to delete messages
- add `delete` flag to `add_rule` function
- add `set_command` function to `EolRule` to set the action to delete
2025-10-08 12:20:34 +01:00
Jerus Bot
9737ef4b7d
chore: update prlog for pr
2025-10-08 11:40:55 +01:00
Jeremiah Russell
4830d95a76
✨ feat(rules_cli): add optional label for retention rules
...
- allows users to specify a custom label when adding a retention rule
- if no label is provided, a unique one will be generated automatically
2025-10-08 11:40:55 +01:00
Jeremiah Russell
432c1635af
✨ feat(config): add labels method to EolRule
...
- add `labels` method to `EolRule` to access labels vector
2025-10-08 11:40:55 +01:00
Jeremiah Russell
cf3d93cf13
✨ feat(config): add support for labels to retention rules
...
- allow associating labels with retention rules for more granular control
- add label parameter to `add_rule` function
- check for duplicate rules and labels before adding new ones
2025-10-08 11:40:55 +01:00
Jerus Bot
5da589678e
chore: update prlog for pr
2025-10-08 10:39:38 +01:00
Jeremiah Russell
5c42c0f66d
✨ feat(config): add retention attribute to EolRule
...
- introduce retention attribute in EolRule struct
- implement getter method for accessing retention value
2025-10-08 10:39:38 +01:00
Jeremiah Russell
7610f2a9dc
✨ feat(config): enhance rule management with BTreeMap
...
- migrate rules from Vec to BTreeMap for efficient access
- add rule existence check to prevent duplicates
- improve rule listing by iterating over values
2025-10-08 10:39:38 +01:00
Jerus Bot
b637d249a9
chore: update prlog for pr
2025-10-08 07:56:41 +01:00
Jeremiah Russell
c1ab9a5333
✨ feat(rules_cli): implement add command
...
- add `add` subcommand to create new retention rules
- allow specifying period and count for message age
- support generating labels for new rules
2025-10-08 07:56:41 +01:00
Jeremiah Russell
7b08bfe13a
✨ feat(retention): add message age enum creation
...
- implement `new` function for MessageAge enum
- allow creating MessageAge from string period and count
2025-10-08 07:56:41 +01:00
Jeremiah Russell
b729ee6a10
✨ feat(rules): add subcommand for rule management
...
- introduce RulesCli to handle rule management commands
- implement `add` subcommand with `AddCli` to add rules to the config
2025-10-08 07:56:41 +01:00
Jeremiah Russell
92e88c4261
📝 docs(retention): add documentation for the retention struct
...
- add documentation for the `new` function
2025-10-08 07:56:41 +01:00