add os to $nu based on rust's understanding (#5243)

* add os to $nu based on rust's understanding

* add a few more constants
This commit is contained in:
Darren Schroeder 2022-04-19 14:11:58 -05:00 committed by GitHub
parent 0de289f6b7
commit f2d47f97da
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1249,6 +1249,18 @@ pub fn eval_variable(
output_cols.push("pid".into());
output_vals.push(Value::int(pid as i64, span));
let os_record = Value::Record {
cols: vec!["os".into(), "arch".into(), "family".into()],
vals: vec![
Value::string(std::env::consts::OS, span),
Value::string(std::env::consts::ARCH, span),
Value::string(std::env::consts::FAMILY, span),
],
span,
};
output_cols.push("os-info".into());
output_vals.push(os_record);
Ok(Value::Record {
cols: output_cols,
vals: output_vals,