Skip to content

Commit 93bcf37

Browse files
Merge pull request #53 from rabbitmq/non-interactive-formatting-single-line
One line per item in non-interactive output
2 parents ffa34b4 + a068369 commit 93bcf37

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/output.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,12 @@ use serde::{Deserialize, Serialize};
2525
use std::fmt;
2626
use sysexits::ExitCode;
2727
use tabled::settings::object::Rows;
28+
2829
use tabled::settings::{Panel, Remove, Style};
29-
use tabled::{Table, Tabled};
30+
use tabled::{
31+
Table, Tabled,
32+
settings::{Format, Modify, object::Segment},
33+
};
3034

3135
#[derive(Default, Serialize, Deserialize, Debug, PartialEq, Eq, Clone, Copy)]
3236
pub enum TableStyle {
@@ -111,7 +115,9 @@ impl TableStyler {
111115

112116
fn apply_borderless(self, table: &mut Table) -> &Table {
113117
table.with(Style::empty());
114-
table.with(Remove::row(Rows::first()))
118+
table.with(tabled::settings::Padding::new(0, 1, 0, 0));
119+
table.with(Remove::row(Rows::first()));
120+
table.with(Modify::new(Segment::all()).with(Format::content(|s| s.replace("\n", ","))))
115121
}
116122

117123
fn apply_markdown(self, table: &mut Table) -> &Table {

0 commit comments

Comments
 (0)