Add infrastructure for experimental options (#16028)

Co-authored-by: Bahex <Bahex@users.noreply.github.com>
This commit is contained in:
Piepmatz
2025-07-01 18:36:51 +02:00
committed by GitHub
parent f4136aa3f4
commit a86a0dd16e
19 changed files with 731 additions and 24 deletions

View File

@ -16,6 +16,7 @@ workspace = true
[dependencies]
nu-engine = { path = "../nu-engine", version = "0.105.2", default-features = false }
nu-experimental = { path = "../nu-experimental", version = "0.105.2" }
nu-parser = { path = "../nu-parser", version = "0.105.2" }
nu-protocol = { path = "../nu-protocol", version = "0.105.2", default-features = false }
nu-utils = { path = "../nu-utils", version = "0.105.2", default-features = false }

View File

@ -188,6 +188,17 @@ pub fn version(engine_state: &EngineState, span: Span) -> Result<PipelineData, S
);
}
record.push(
"experimental_options",
Value::string(
nu_experimental::ALL
.iter()
.map(|option| format!("{}={}", option.identifier(), option.get()))
.join(", "),
span,
),
);
Ok(Value::record(record, span).into_pipeline_data())
}