*-c, --output-width* _width_::
Output is formatted to a width specified as number of characters. The original name of this option is *--columns*; this name is deprecated since v2.30. Note that input longer than _width_ is not truncated by default. The default is a terminal width and the 80 columns in non-interactive mode. The column headers are never truncated.
++
+The placeholder "unlimited" (or 0) is possible to use to not restrict output width. This is recommended for example when output to the files rather than on terminal.
*-d, --table-noheadings*::
Do not print header. This option allows the use of logical column names on the command line, but keeps the header hidden when printing the table.
struct column_control {
int mode; /* COLUMN_MODE_* */
- size_t termwidth;
+ size_t termwidth; /* -1 uninilialized, 0 unlimited, >0 width (default is 80) */
struct libscols_table *tab;
static void modify_table(struct column_control *ctl)
{
- scols_table_set_termwidth(ctl->tab, ctl->termwidth);
- scols_table_set_termforce(ctl->tab, SCOLS_TERMFORCE_ALWAYS);
+ if (ctl->termwidth > 0) {
+ scols_table_set_termwidth(ctl->tab, ctl->termwidth);
+ scols_table_set_termforce(ctl->tab, SCOLS_TERMFORCE_ALWAYS);
+ }
if (ctl->tab_colright)
apply_columnflag_from_list(ctl, ctl->tab_colright,
switch(c) {
case 'c':
- ctl.termwidth = strtou32_or_err(optarg, _("invalid columns argument"));
+ if (strcmp(optarg, "unlimited") == 0)
+ ctl.termwidth = 0;
+ else
+ ctl.termwidth = strtou32_or_err(optarg, _("invalid columns argument"));
break;
case 'd':
ctl.tab_noheadings = 1;