diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2009-02-20 15:02:04 +0000 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2009-02-20 15:02:04 +0000 |
commit | 1ac6060e10451ba404a7ffff60d1670569b5c090 (patch) | |
tree | 5edfb516f93dd95896d5f9205210b14be0fed251 /gpsmon.c | |
parent | 65575cab2d574563adfe33f793d7a6b19bb8fc39 (diff) | |
download | gpsd-1ac6060e10451ba404a7ffff60d1670569b5c090.tar.gz |
Implement -l option analogous to gpsctl -l.
Diffstat (limited to 'gpsmon.c')
-rw-r--r-- | gpsmon.c | 24 |
1 files changed, 23 insertions, 1 deletions
@@ -340,7 +340,7 @@ int main (int argc, char **argv) gmt_offset = (int)tzoffset(); /*@ -branchstate @*/ - while ((option = getopt(argc, argv, "D:F:Vh")) != -1) { + while ((option = getopt(argc, argv, "D:F:Vhl")) != -1) { switch (option) { case 'D': debuglevel = atoi(optarg); @@ -351,6 +351,28 @@ int main (int argc, char **argv) case 'V': (void)printf("gpsmon %s\n", VERSION); exit(0); + case 'l': /* list known device types */ + for (active = monitor_objects; *active; active++) { + (void)fputs((*active)->driver->type_name, stdout); + (void)fputs("\ti l", stdout); + (void)fputc(' ', stdout); + if ((*active)->driver->mode_switcher != NULL) + (void)fputc('n', stdout); + else + (void)fputc(' ', stdout); + (void)fputc(' ', stdout); + if ((*active)->driver->speed_switcher != NULL) + (void)fputc('s', stdout); + else + (void)fputc(' ', stdout); + (void)fputc(' ', stdout); + if ((*active)->driver->control_send != NULL) + (void)fputc('c', stdout); + else + (void)fputc(' ', stdout); + (void)fputc('\n', stdout); + } + exit(0); case 'h': case '?': default: (void)fputs("usage: gpsmon [-?hv] [-F controlsock] [server[:port:[device]]]\n", stderr); exit(1); |