Skip to content

Commit

Permalink
last: Add time-format to usage output and man page
Browse files Browse the repository at this point in the history
  • Loading branch information
Nykseli authored and thkukuk committed Jan 8, 2024
1 parent 3fa622c commit 08cc914
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
21 changes: 21 additions & 0 deletions man/wtmpdb.8.xml
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,27 @@
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<option>--time-format</option>
<replaceable>FORMAT</replaceable>
</term>
<listitem>
<para>
Display timestamps in the specified
<replaceable>FORMAT</replaceable>. The format can be
<replaceable>notime</replaceable>,
<replaceable>short</replaceable>,
<replaceable>full</replaceable>, or
<replaceable>iso</replaceable>.
<replaceable>notime</replaceable> will not display times at
all, <replaceable>short</replaceable> is the default option,
<replaceable>full</replaceable> will display the full times
and dates, and <replaceable>iso</replaceable> will display
times in ISO-8601 format.
</para>
</listitem>
</varlistentry>
</variablelist>
<para>
<replaceable>TIME</replaceable> must be in the format
Expand Down
3 changes: 3 additions & 0 deletions src/wtmpdb.c
Original file line number Diff line number Diff line change
Expand Up @@ -541,6 +541,9 @@ usage (int retval)
fputs (" -t, --until TIME Display who was logged in until TIME\n", output);
fputs (" -w, --fullnames Display full IP addresses and user and domain names\n", output);
fputs (" -x, --system Display system shutdown entries\n", output);
fputs (" --time-format FORMAT Display timestamps in the specified FORMAT:\n", output);
fputs (" notime|short|full|iso\n", output);

fputs (" [username...] Display only entries matching these arguments\n", output);
fputs (" [tty...] Display only entries matching these arguments\n", output);
fputs ("TIME must be in the format \"YYYY-MM-DD HH:MM:SS\"\n", output);
Expand Down

0 comments on commit 08cc914

Please sign in to comment.