load_yaml

Function load_yaml 

Source
pub fn load_yaml(content: &str) -> Result<CommandsConfig>
Expand description

Load configuration from a YAML string

Parses YAML content and deserializes it into a CommandsConfig. Provides detailed error messages with line and column information when parsing fails.

§Arguments

  • content - YAML string to parse

§Returns

Parsed CommandsConfig on success

§Errors

§Example

use dynamic_cli::config::loader::load_yaml;

let yaml = r#"
metadata:
  version: "1.0.0"
  prompt: "test"
commands: []
global_options: []
"#;

let config = load_yaml(yaml).unwrap();
assert_eq!(config.metadata.version, "1.0.0");