Add variable type to output

This commit is contained in:
Dmitry Sharshakov 2021-08-22 08:31:01 +03:00
parent cc66475592
commit 89ad54a2e5
No known key found for this signature in database
GPG Key ID: 471FD32E15FD8473

View File

@ -1937,7 +1937,11 @@ mod cmd {
Ok(vars) => {
let mut s = String::new();
for var in vars {
s.push_str(&format!("{} = {}; ", var.name, var.value));
let prefix = match var.data_type {
Some(data_type) => format!("{} ", data_type),
None => "".to_owned(),
};
s.push_str(&format!("{}{} = {}; ", prefix, var.name, var.value));
}
s
}