Commit Graph

798 Commits

Author SHA1 Message Date
Jerus Bot
2fd6c8d542 chore: update prlog for pr 2025-10-09 14:30:21 +01:00
Jeremiah Russell
40ea9e52f4 ♻️ refactor(cli): rename command to sub_command for clarity
- rename `command` field to `sub_command` in `Cli` and `ConfigCli` structs
- rename `Commands` enum to `SubCmds` to reflect its role as subcommand
- update references to the renamed fields and enum variants
- this improves code readability and avoids confusion with other command concepts

🐛 fix(config): correct method name for setting eol action

- rename `set_command` to `set_action` in `EolRule` struct
- update references in `config.rs` to use the correct method name
- this fixes a bug where the eol action was not being set correctly
2025-10-09 14:30:21 +01:00
Jerus Bot
e80c7e3273 chore: update prlog for pr 2025-10-09 14:12:41 +01:00
Jeremiah Russell
992e62f0c9 🐛 fix(config): correct typo in eol_cmd module name
- fix a typo in the module name from `eol_cmd` to `eol_action`
- update the `set_command` function to accept a reference to `EolAction`
2025-10-09 14:12:41 +01:00
Jeremiah Russell
ae41e86744 ♻️ refactor(core): rename eol_cmd module to eol_action
- rename `eol_cmd` module to `eol_action` for clarity
- update module import and export statements
2025-10-09 14:12:41 +01:00
Jeremiah Russell
a317372d3a ♻️ refactor(core): rename eol_cmd to eol_action
- clarifies the file's purpose as defining actions related to EOL handling rather than just commands
2025-10-09 14:12:41 +01:00
Jeremiah Russell
fdc36096dc feat(config): add functionality to set action on rule
- add `set_action_on_rule` function to modify rule action
- allow users to update action (e.g., delete) for specific rules
2025-10-09 14:12:41 +01:00
Jeremiah Russell
6b4f0bf214 feat(cli): add action subcommand
- implement action subcommand to set actions on rules
- create action_cli module to handle action-related commands
2025-10-09 14:12:41 +01:00
Jeremiah Russell
7f43b90102 feat(config_cli): implement action subcommand
- adds a new subcommand to configure actions on rules
- allows setting action to trash or delete for a specific rule id
2025-10-09 14:12:41 +01:00
Jerus Bot
43c13dfe5f chore: update prlog for pr 2025-10-09 13:00:18 +01:00
Jeremiah Russell
b9fec9a064 🐛 fix(eol_rule): correct grammar in rule descriptions
- improve clarity and grammatical correctness of EolRule descriptions
- use backticks for retention values for better readability
2025-10-09 13:00:18 +01:00
Jeremiah Russell
02d7a49f31 🐛 fix(config): correct grammar in EolRule display
- fix grammar error in EolRule display implementation
2025-10-09 13:00:18 +01:00
Jerus Bot
ae27ad73f3 chore: update prlog for pr 2025-10-09 12:32:56 +01:00
Jeremiah Russell
95e19884a2 🐛 fix(remove_cli): handle rule not found when removing label
- return error if rule not found when removing label
2025-10-09 12:32:56 +01:00
Jeremiah Russell
66dd0dc983 feat(config): add remove label from rule
- implement remove_label_from_rule function to delete labels from rules
- add error handling for rule not found
- save configuration after removing the label
2025-10-09 12:32:56 +01:00
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