const char *journal_path;
- unsigned int selinux_enabled : 1;
+ unsigned int selinux_enabled : 1,
+ noheadings : 1;
};
/* these have to remain global since there's no other reasonable way to pass
return 0;
}
-static struct libscols_table *setup_table(void)
+static struct libscols_table *setup_table(struct lslogins_control *ctl)
{
struct libscols_table *tb = scols_new_table();
int n = 0;
+
if (!tb)
- return NULL;
+ errx(EXIT_FAILURE, _("failed to initialize output table"));
+ if (ctl->noheadings)
+ scols_table_enable_noheadings(tb, 1);
switch(outmode) {
case OUT_COLON:
static int print_user_table(struct lslogins_control *ctl)
{
- tb = setup_table();
+ tb = setup_table(ctl);
if (!tb)
return -1;
fputs(_(" -l, --logins=<logins> display only users from <logins>\n"), out);
fputs(_(" -m, --supp-groups display supplementary groups as well\n"), out);
fputs(_(" -n, --newline display each piece of information on a new line\n"), out);
+ fputs(_(" --noheadings don't print headings\n"), out);
fputs(_(" --notruncate don't truncate output\n"), out);
fputs(_(" -o, --output[=<list>] define the columns to output\n"), out);
fputs(_(" -p, --pwd display information related to login by password.\n"), out);
OPT_WTMP,
OPT_BTMP,
OPT_NOTRUNC,
+ OPT_NOHEAD,
OPT_TIME_FMT,
};
{ "supp-groups", no_argument, 0, 'G' },
{ "newline", no_argument, 0, 'n' },
{ "notruncate", no_argument, 0, OPT_NOTRUNC },
+ { "noheadings", no_argument, 0, OPT_NOHEAD },
{ "output", required_argument, 0, 'o' },
{ "last", no_argument, 0, 'L', },
{ "raw", no_argument, 0, 'r' },
case OPT_NOTRUNC:
coldescs[COL_GECOS].flag = 0;
break;
+ case OPT_NOHEAD:
+ ctl->noheadings = 1;
+ break;
case OPT_TIME_FMT:
{
size_t i;