Commit Graph

233 Commits

Author SHA1 Message Date
Jerus Bot
eaa7d4be12 chore: update prlog for pr 2025-10-09 11:19:11 +01:00
Jeremiah Russell
1ff33bba3f 🐛 fix(label_cli): fix add label logic
- correct logic for adding label to rule
2025-10-09 11:19:11 +01:00
Jeremiah Russell
d6ee9f5227 🐛 fix(cli): correct output format for label list
- change the output format for label list from logging to printing to the console
- modify the loop logic to output labels in a comma-separated format
2025-10-09 11:19:11 +01:00
Jeremiah Russell
0a537e4df7 feat(config): add label functionality to rules
- add function to add labels to existing rules
- implement save function to persist changes to the config file
2025-10-09 11:19:11 +01:00
Jerus Bot
091dc360c6 chore: update prlog for pr 2025-10-09 09:53:09 +01:00
Jeremiah Russell
adc50f63a2 ♻️ refactor(config): make EolRule fields public
- make EolRule fields public for external access
2025-10-09 09:53:09 +01:00
Jeremiah Russell
3628f6a291 feat(error): add RuleNotFound error
- add new error type for when a rule is not found by ID
2025-10-09 09:53:09 +01:00
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