pub fn parse_config(
engine: &mut Engine,
script: &str,
) -> Result<NuScriptConfig, Error>Expand description
Parse a script into a NuScriptConfig struct.
This function parses a Nushell script, loads its defined modules, and extracts the run closure
and the full configuration value.
The process involves:
- A first pass evaluation of the script to extract
modulesdefinitions. - Loading these modules into the provided
engine. - A second pass evaluation (of the main script block) to obtain the
runclosure (which can now reference the loaded modules) and the script’s full output Value.