--- a/java/sql-dk/src/info/globalcode/sql/dk/formatting/TabularFormatter.java Mon Dec 30 23:46:41 2013 +0100
+++ b/java/sql-dk/src/info/globalcode/sql/dk/formatting/TabularFormatter.java Tue Dec 31 17:35:33 2013 +0100
@@ -33,21 +33,27 @@
public static final String NAME = "tabular"; // bash-completion:formatter
private static final String HEADER_TYPE_PREFIX = " (";
private static final String HEADER_TYPE_SUFFIX = ")";
+ public static final String PROPERTY_ASCII = "ascii";
+ public static final String PROPERTY_COLORFUL = "color";
+ public static final String PROPERTY_TRIM = "trim";
private ColorfulPrintWriter out;
private boolean firstResult = true;
private int[] columnWidth;
/**
* use ASCII borders instead of unicode ones
*/
- private final boolean asciiNostalgia = false;
+ private final boolean asciiNostalgia;
/**
* Trim values if they are longer than cell size
*/
- private final boolean trimValues = false;
+ private final boolean trimValues;
public TabularFormatter(FormatterContext formatterContext) {
super(formatterContext);
out = new ColorfulPrintWriter(formatterContext.getOutputStream());
+ asciiNostalgia = formatterContext.getProperties().getBoolean(PROPERTY_ASCII, false);
+ trimValues = formatterContext.getProperties().getBoolean(PROPERTY_TRIM, false);
+ out.setColorful(formatterContext.getProperties().getBoolean(PROPERTY_COLORFUL, true));
}
@Override