aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/binlogcat.c20
-rw-r--r--src/binlogsel.c25
-rw-r--r--src/err.c9
-rw-r--r--src/err.h1
4 files changed, 51 insertions, 4 deletions
diff --git a/src/binlogcat.c b/src/binlogcat.c
index 656d8f2..ada8efe 100644
--- a/src/binlogcat.c
+++ b/src/binlogcat.c
@@ -142,3 +142,16 @@ help()
{
- printf("usage: %s [-dhnv] [-t FORMAT] [FILE...]\n", progname);
+ printf("usage: %s [-dhnVv] [-t FORMAT] [FILE...]\n", progname);
+ printf("Format binary log files in human-readable form\n");
+ printf("\nOptions are:\n\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 FORMAT format timestamps according to FORMAT\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);
}
@@ -151,3 +164,3 @@ main(int argc, char **argv)
setprogname(argv[0]);
- while ((c = getopt(argc, argv, "dht:nv")) != EOF)
+ while ((c = getopt(argc, argv, "dht:nVv")) != EOF)
switch (c) {
@@ -166,2 +179,5 @@ main(int argc, char **argv)
break;
+ case 'V':
+ version();
+ exit(0);
case 'v':
diff --git a/src/binlogsel.c b/src/binlogsel.c
index 8f1cfce..b05b12c 100644
--- a/src/binlogsel.c
+++ b/src/binlogsel.c
@@ -55,3 +55,21 @@ 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);
}
@@ -616,3 +634,3 @@ main(int argc, char **argv)
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) {
@@ -660,2 +678,5 @@ main(int argc, char **argv)
break;
+ case 'V':
+ version();
+ exit(0);
case 'v':
diff --git a/src/err.c b/src/err.c
index 73aaba7..5c4d8d8 100644
--- a/src/err.c
+++ b/src/err.c
@@ -62 +62,10 @@ packerror(const char *fmt, ...)
+void
+version(void)
+{
+ printf("%s (%s) %s\n", progname, PACKAGE_TARNAME, PACKAGE_VERSION);
+ printf("Copyright (C) 2013 Sergey Poznyakoff\n");
+ printf("License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>\n");
+ printf("This is free software: you are free to change and redistribute it.\n");
+ printf("There is NO WARRANTY, to the extent permitted by law.\n");
+}
diff --git a/src/err.h b/src/err.h
index 69139fd..aab01be 100644
--- a/src/err.h
+++ b/src/err.h
@@ -21 +21,2 @@ void error(const char *fmt, ...);
void packerror(const char *fmt, ...);
+void version(void);

Return to:

Send suggestions and report system problems to the System administrator.