diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2013-10-15 20:07:26 +0300 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2013-10-15 20:07:26 +0300 |
commit | 7d0beb6599c53544739409ca4aec104bf27a3f35 (patch) | |
tree | b561fbba7c9acedec17cbc398cee12a465faad6e /src/binlogsel.c | |
parent | ef3f928cc712f6774e19f8cb8f880cbeac15e8ff (diff) | |
download | vmod-binlog-7d0beb6599c53544739409ca4aec104bf27a3f35.tar.gz vmod-binlog-7d0beb6599c53544739409ca4aec104bf27a3f35.tar.bz2 |
Add version and help output to command line utilities.
Diffstat (limited to 'src/binlogsel.c')
-rw-r--r-- | src/binlogsel.c | 25 |
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); | |||
53 | void | 53 | void |
54 | help() | 54 | help() |
55 | { | 55 | { |
56 | printf("usage: %s [-dhnv] [-t FORMAT] [-F FROMTIME] [-T TOTIME] [-p PATTERN] [-D DIR] [FILE...]\n", progname); | 56 | printf("usage: %s [-dhnVv] [-t FORMAT] [-F TIME] [-T TIME] [-p PATTERN] [-D DIR] [FILE...]\n", progname); |
57 | printf("Select records from binary logs\n"); | ||
58 | printf("\nOptions are:\n\n"); | ||
59 | printf(" -D DIR log file storage directory\n"); | ||
60 | printf(" -F TIME print records starting from TIME\n"); | ||
61 | printf(" -T TIME print records starting up to TIME\n"); | ||
62 | printf(" -p PATTERN select files matching PATTERN\n"); | ||
63 | printf("\n"); | ||
64 | printf(" -d print timestamps relative to first record in the file\n"); | ||
65 | printf(" -n output record numbers\n"); | ||
66 | printf(" -v print information about each file\n"); | ||
67 | printf(" -t FMT format timestamps according to FMT\n"); | ||
68 | printf("\n"); | ||
69 | printf(" -h print this help summary\n"); | ||
70 | printf(" -V show program version\n"); | ||
71 | printf("\n"); | ||
72 | printf("Report bugs and suggestions to <%s>\n", PACKAGE_BUGREPORT); | ||
73 | if (sizeof(PACKAGE_URL) > 1) | ||
74 | printf("%s home page: <%s>\n", PACKAGE_NAME, PACKAGE_URL); | ||
57 | } | 75 | } |
58 | 76 | ||
59 | /* Convert strftime-like pattern into globbing pattern */ | 77 | /* Convert strftime-like pattern into globbing pattern */ |
@@ -614,7 +632,7 @@ main(int argc, char **argv) | |||
614 | struct timespec ts; | 632 | struct timespec ts; |
615 | 633 | ||
616 | setprogname(argv[0]); | 634 | setprogname(argv[0]); |
617 | while ((c = getopt(argc, argv, "D:dF:hi:p:T:t:nv")) != EOF) | 635 | while ((c = getopt(argc, argv, "D:dF:hi:p:T:t:nV")) != EOF) |
618 | switch (c) { | 636 | switch (c) { |
619 | case 'D': | 637 | case 'D': |
620 | directory = optarg; | 638 | directory = optarg; |
@@ -658,6 +676,9 @@ main(int argc, char **argv) | |||
658 | case 'n': | 676 | case 'n': |
659 | number_option = 1; | 677 | number_option = 1; |
660 | break; | 678 | break; |
679 | case 'V': | ||
680 | version(); | ||
681 | exit(0); | ||
661 | case 'v': | 682 | case 'v': |
662 | verbose_option = 1; | 683 | verbose_option = 1; |
663 | break; | 684 | break; |