summaryrefslogtreecommitdiffabout
path: root/src/binlogsel.c
authorSergey Poznyakoff <gray@gnu.org.ua>2013-10-15 17:07:26 (GMT)
committer Sergey Poznyakoff <gray@gnu.org.ua>2013-10-15 17:07:26 (GMT)
commit7d0beb6599c53544739409ca4aec104bf27a3f35 (patch) (side-by-side diff)
treeb561fbba7c9acedec17cbc398cee12a465faad6e /src/binlogsel.c
parentef3f928cc712f6774e19f8cb8f880cbeac15e8ff (diff)
downloadvmod-binlog-7d0beb6599c53544739409ca4aec104bf27a3f35.tar.gz
vmod-binlog-7d0beb6599c53544739409ca4aec104bf27a3f35.tar.bz2
Add version and help output to command line utilities.
Diffstat (limited to 'src/binlogsel.c') (more/less context) (show whitespace changes)
-rw-r--r--src/binlogsel.c25
1 files changed, 23 insertions, 2 deletions
diff --git a/src/binlogsel.c b/src/binlogsel.c
index 8f1cfce..b05b12c 100644
--- a/src/binlogsel.c
+++ b/src/binlogsel.c
@@ -53,7 +53,25 @@ void selglob(const char *dir, const char *pattern);
void
help()
{
- printf("usage: %s [-dhnv] [-t FORMAT] [-F FROMTIME] [-T TOTIME] [-p PATTERN] [-D DIR] [FILE...]\n", progname);
+ printf("usage: %s [-dhnVv] [-t FORMAT] [-F TIME] [-T TIME] [-p PATTERN] [-D DIR] [FILE...]\n", progname);
+ printf("Select records from binary logs\n");
+ printf("\nOptions are:\n\n");
+ printf(" -D DIR log file storage directory\n");
+ printf(" -F TIME print records starting from TIME\n");
+ printf(" -T TIME print records starting up to TIME\n");
+ printf(" -p PATTERN select files matching PATTERN\n");
+ printf("\n");
+ printf(" -d print timestamps relative to first record in the file\n");
+ printf(" -n output record numbers\n");
+ printf(" -v print information about each file\n");
+ printf(" -t FMT format timestamps according to FMT\n");
+ printf("\n");
+ printf(" -h print this help summary\n");
+ printf(" -V show program version\n");
+ printf("\n");
+ printf("Report bugs and suggestions to <%s>\n", PACKAGE_BUGREPORT);
+ if (sizeof(PACKAGE_URL) > 1)
+ printf("%s home page: <%s>\n", PACKAGE_NAME, PACKAGE_URL);
}
/* Convert strftime-like pattern into globbing pattern */
@@ -614,7 +632,7 @@ main(int argc, char **argv)
struct timespec ts;
setprogname(argv[0]);
- while ((c = getopt(argc, argv, "D:dF:hi:p:T:t:nv")) != EOF)
+ while ((c = getopt(argc, argv, "D:dF:hi:p:T:t:nV")) != EOF)
switch (c) {
case 'D':
directory = optarg;
@@ -658,6 +676,9 @@ main(int argc, char **argv)
case 'n':
number_option = 1;
break;
+ case 'V':
+ version();
+ exit(0);
case 'v':
verbose_option = 1;
break;

Return to:

Send suggestions and report system problems to the System administrator.