\fButmpdump\fP is a simple program to dump UTMP and WTMP files
in raw format, so they can be examined.
.SH OPTIONS
-.IP \fB\-f\fP
+.IP "\fB\-f, \-\-follow\fP"
output appended data as the file grows.
-.IP "\fB\-r\fP"
-reverse. Write back edited login information into utmp or wtmp files.
-.IP \fB\-h\fP
-usage information.
-.PP
-utmpdump can be useful in cases of corrupted utmp or wtmp entries.
-It can dump out utmp/wtmp to an ASCII file, then that file can
-be edited to remove bogus entries and reintegrated, using
+.IP "\fB\-r, \-\-reverse\fP
+Undump, write back edited login information into utmp or wtmp files.
+.IP "\fB\-h, \-\-help\fP"
+Print a help text and exit.
+.IP "\fB\-V, \-\-version\fP"
+Output version information and exit.
+.SH NOTES
+utmpdump can be useful in cases of corrupted utmp or wtmp entries. It can dump
+out utmp/wtmp to an ASCII file, then that file can be edited to remove bogus
+entries and reintegrated, using
.PP
.sp 1
.in +1c
#include <utmp.h>
#include <time.h>
#include <ctype.h>
+#include <getopt.h>
#include <unistd.h>
#include <netinet/in.h>
#include <arpa/inet.h>
void
usage(int result)
{
- printf(_("Usage: utmpdump [ -frh ] [ filename ]\n"));
+ printf(_("Usage: utmpdump [ -frhV ] [ filename ]\n"));
exit(result);
}
int reverse = 0, forever = 0;
const char *filename = NULL;
+ static const struct option longopts[] = {
+ { "follow", 0, 0, 'f' },
+ { "reverse", 0, 0, 'r' },
+ { "help", 0, 0, 'h' },
+ { "version", 0, 0, 'V' },
+ { NULL, 0, 0, 0 }
+ };
+
setlocale(LC_ALL, "");
bindtextdomain(PACKAGE, LOCALEDIR);
textdomain(PACKAGE);
atexit(close_stdout);
- while ((c = getopt(argc, argv, "froh")) != EOF) {
+ while ((c = getopt_long(argc, argv, "frhV", longopts, NULL)) != -1) {
switch (c) {
case 'r':
reverse = 1;
case 'h':
usage(0);
break;
-
+ case 'V':
+ printf(UTIL_LINUX_VERSION);
+ break;
default:
usage(1);
}