diff options
author | Gary E. Miller <gem@rellim.com> | 2016-06-15 19:10:47 -0700 |
---|---|---|
committer | Gary E. Miller <gem@rellim.com> | 2016-06-15 19:10:47 -0700 |
commit | cb848db6eacc9cb755a8bb4a1354ab7fd18342fe (patch) | |
tree | 188dea22c9d050cfd293e1f0d9c4858bd728590a /ntpshmmon.c | |
parent | de6e26f9dc3f824a875b3258871aa11bd0c6001b (diff) | |
download | gpsd-cb848db6eacc9cb755a8bb4a1354ab7fd18342fe.tar.gz |
Expand the -h option in ntpshmmon.
Many thanks to Nuno Gonçalves <nunojpg@gmail.com> for clarifying the
problems in ntpshmmon.
Diffstat (limited to 'ntpshmmon.c')
-rw-r--r-- | ntpshmmon.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/ntpshmmon.c b/ntpshmmon.c index 28187ba6..f46bf1ca 100644 --- a/ntpshmmon.c +++ b/ntpshmmon.c @@ -33,7 +33,6 @@ int main(int argc, char **argv) memset( shm_stat_old, 0 ,sizeof( shm_stat_old)); -#define USAGE "usage: ntpshmmon [-s] [-n max] [-t timeout] [-v] [-h] [-V]\n" while ((option = getopt(argc, argv, "hn:st:vV")) != -1) { switch (option) { case 'n': @@ -53,8 +52,18 @@ int main(int argc, char **argv) argv[0], VERSION, REVISION); exit(EXIT_SUCCESS); case 'h': + fprintf(stderr, + "usage: ntpshmmon [-s] [-n max] [-t timeout] [-v] [-h] [-V]\n" + " -h print this help\n" + " -n nsamples exit after nsamples\n" + " -s remove SHMs and exit\n" + " -t nseconds exit after nseconds\n" + " -v be verbose\n" + " -V print version and exit\n" + ); + exit(EXIT_SUCCESS); default: - fprintf(stderr, USAGE); + /* no option, just go and do it */ break; } } |