diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2015-03-02 08:53:43 -0500 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2015-03-02 08:53:43 -0500 |
commit | 38731e137dbbd6997ea9b416a536a7b706bc7c53 (patch) | |
tree | 649dc25dfdcac15cca1dc03070d100d03b9ecb36 /ntpshmmon.c | |
parent | f6da7019a34bf4a61847384b0f4eb97f1786e73b (diff) | |
download | gpsd-38731e137dbbd6997ea9b416a536a7b706bc7c53.tar.gz |
Add -V option to ntpshmmon.
Diffstat (limited to 'ntpshmmon.c')
-rw-r--r-- | ntpshmmon.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/ntpshmmon.c b/ntpshmmon.c index 044f9268..8a3b5321 100644 --- a/ntpshmmon.c +++ b/ntpshmmon.c @@ -11,7 +11,9 @@ #include <unistd.h> #endif /* S_SPLINT_S */ +#include "gpsd_config.h" #include "ntpshm.h" +#include "revision.h" #define NTPSEGMENTS 256 /* NTPx for x any byte */ @@ -35,8 +37,8 @@ int main(int argc, char **argv) int i; bool verbose = false; -#define USAGE "usage: ntpshmmon [-s] [-v] [-h]\n" - while ((option = getopt(argc, argv, "hsv")) != -1) { +#define USAGE "usage: ntpshmmon [-s] [-v] [-h] [-V]\n" + while ((option = getopt(argc, argv, "hsvV")) != -1) { switch (option) { case 's': if (units > 0) { @@ -50,6 +52,10 @@ int main(int argc, char **argv) case 'v': verbose = true; break; + case 'V': + (void)fprintf(stderr, "version %s (revision %s)\n", + VERSION, REVISION); + exit(EXIT_SUCCESS); case 'h': default: fprintf(stderr, USAGE); |