#define get_status(x) (outmode == OUT_PRETTY ? pretty_status[(x)] : status[(x)])
-static struct lslogins_coldesc coldescs[] =
+static const struct lslogins_coldesc coldescs[] =
{
[COL_USER] = { "USER", N_("user name"), N_("Username"), 0.1, SCOLS_FL_NOEXTREMES },
[COL_UID] = { "UID", N_("user ID"), "UID", 1, SCOLS_FL_RIGHT},
const char *journal_path;
unsigned int selinux_enabled : 1,
- noheadings : 1;
+ noheadings : 1,
+ notrunc : 1;
};
/* these have to remain global since there's no other reasonable way to pass
}
while (n < ncolumns) {
- if (!scols_table_new_column(tb, coldescs[columns[n]].name,
- coldescs[columns[n]].whint, coldescs[columns[n]].flag))
+ int flags = coldescs[columns[n]].flag;
+
+ if (ctl->notrunc)
+ flags &= ~SCOLS_FL_TRUNC;
+
+ if (!scols_table_new_column(tb,
+ coldescs[columns[n]].name,
+ coldescs[columns[n]].whint,
+ flags))
goto fail;
++n;
}
fprintf(out, _("\nAvailable columns:\n"));
for (i = 0; i < ARRAY_SIZE(coldescs); i++)
- fprintf(out, " %14s %s\n", coldescs[i].name, _(coldescs[i].help));
+ fprintf(out, " %14s %s\n", coldescs[i].name,
+ _(coldescs[i].help));
fprintf(out, _("\nFor more details see lslogins(1).\n"));
path_btmp = optarg;
break;
case OPT_NOTRUNC:
- coldescs[COL_GECOS].flag = 0;
+ ctl->notrunc = 1;
break;
case OPT_NOHEAD:
ctl->noheadings = 1;