♻️ 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
This commit is contained in:
committed by
Jeremiah Russell
parent
e80c7e3273
commit
40ea9e52f4
@@ -85,7 +85,7 @@ impl Config {
|
||||
rule.add_label(l);
|
||||
}
|
||||
if delete {
|
||||
rule.set_command(&EolAction::Delete);
|
||||
rule.set_action(&EolAction::Delete);
|
||||
}
|
||||
log::info!("added rule: {rule}");
|
||||
self.rules.insert(rule.id().to_string(), rule);
|
||||
@@ -178,7 +178,7 @@ impl Config {
|
||||
let Some(rule) = self.rules.get_mut(id.to_string().as_str()) else {
|
||||
return Err(Error::RuleNotFound(id));
|
||||
};
|
||||
rule.set_command(action);
|
||||
rule.set_action(action);
|
||||
self.save()?;
|
||||
println!("Action set to `{action}` on rule `#{id}`");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user