Skip to content

Commit

Permalink
add -o env output
Browse files Browse the repository at this point in the history
  • Loading branch information
tangowithfoxtrot committed Nov 3, 2023
1 parent 13a195c commit af1b4fe
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions crates/bws/src/render.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ use serde::Serialize;
pub(crate) enum Output {
JSON,
YAML,
Env,
Table,
TSV,
None,
Expand Down Expand Up @@ -49,6 +50,14 @@ pub(crate) fn serialize_response<T: Serialize + TableSerialize<N>, const N: usiz
let text = serde_yaml::to_string(&data).unwrap();
pretty_print("yaml", &text, color);
}
Output::Env => {
let text: Vec<String> = data
.get_values()
.into_iter()
.map(|row| format!("{}=\"{}\"", row[1], row[2]))
.collect();
println!("{}", text.join("\n"));
}
Output::Table => {
let mut table = Table::new();
table
Expand Down

0 comments on commit af1b4fe

Please sign in to comment.