✨ feat: integrate configurable rules path throughout CLI
- Make parse_config_root() public for reuse in main.rs - Add get_rules_path() helper to extract and resolve rules path from config - Update main CLI to use configured rules path for default rule execution - Add run_with_rules_path() method to RulesCli for custom path support - Update all unit tests to include rules_dir field - Rules path now supports h:, c:, r: prefixes throughout the application
This commit is contained in:
committed by
Jeremiah Russell
parent
20b36a00ed
commit
bcb93fd68f
@@ -60,7 +60,13 @@ use cull_gmail::{ClientConfig, Error, GmailClient, Result};
|
||||
use lazy_regex::{Lazy, Regex, lazy_regex};
|
||||
|
||||
/// Parse configuration root path with h:, c:, r: prefixes.
|
||||
fn parse_config_root(path_str: &str) -> PathBuf {
|
||||
///
|
||||
/// Supports:
|
||||
/// - `h:path` - Relative to home directory
|
||||
/// - `c:path` - Relative to current directory
|
||||
/// - `r:path` - Relative to filesystem root
|
||||
/// - `path` - Use path as-is
|
||||
pub fn parse_config_root(path_str: &str) -> PathBuf {
|
||||
static ROOT_CONFIG: Lazy<Regex> = lazy_regex!(r"^(?P<class>[hrc]):(?P<path>.+)$");
|
||||
|
||||
if let Some(captures) = ROOT_CONFIG.captures(path_str) {
|
||||
|
||||
Reference in New Issue
Block a user