pub fn run<P: AsRef<Path>>(
config_path: P,
query_path: &str,
options: QueryOptions,
adapter: &impl ConfigPort,
) -> Result<Option<String>>Expand description
Queries a theme value by path.
Loads the configuration, validates it, and extracts the value at the
specified path. Returns None if the path is not recognized.
§Arguments
config_path— Path to the configuration filequery_path— Dot-separated path to the value (e.g., “colors.accent”)options— Query optionsadapter— Configuration adapter for loading TOML
§Returns
Ok(Some(value))— Path found, value returned as stringOk(None)— Path not recognizedErr(FernError)— Configuration error
§Example
ⓘ
use fernctl::commands::query::{run, QueryOptions};
use fernctl::adapters::TomlConfigAdapter;
let adapter = TomlConfigAdapter::new();
let options = QueryOptions::default();
match run(&config_path, "colors.accent", options, &adapter)? {
Some(value) => println!("{}", value),
None => eprintln!("Unknown path"),
}