diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2006-10-30 22:02:09 +0000 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2006-10-30 22:02:09 +0000 |
commit | 768053d2716143a445af839ba5923fca01578c71 (patch) | |
tree | d64c0a6b6a2884d6357c442af44fa04d3a2e6f3c /xgps.c | |
parent | f77433d6c53cf31cdb375e11f51c6389169bcbb1 (diff) | |
download | gpsd-768053d2716143a445af839ba5923fca01578c71.tar.gz |
Implement -j option in xgps. Document it in cgps.
Diffstat (limited to 'xgps.c')
-rw-r--r-- | xgps.c | 13 |
1 files changed, 10 insertions, 3 deletions
@@ -431,6 +431,7 @@ static void update_panel(struct gps_data_t *gpsdata, char *arg = NULL, *colon1, *colon2, *device = NULL, *server = NULL, *port = DEFAULT_GPSD_PORT; char *su, *au; char *err_str = NULL; + bool jitteropt = false; /*@ -onlytrans */ toplevel = XtVaAppInitialize(&app, "xgps", @@ -458,11 +459,14 @@ static void update_panel(struct gps_data_t *gpsdata, (void)fprintf(stderr, "xgps: unknown altitude unit, defaulting to %s\n", altunits->legend); altunits_ok:; - while ((option = getopt(argc, argv, "hl:s:V")) != -1) { + while ((option = getopt(argc, argv, "hjl:s:V")) != -1) { switch (option) { case 'V': (void)printf("xgps %s\n", VERSION); exit(0); + case 'j': + jitteropt = true; + continue; case 'l': switch ( optarg[0] ) { case 'd': @@ -534,10 +538,13 @@ static void update_panel(struct gps_data_t *gpsdata, gps_set_raw_hook(gpsdata, update_panel); + if (jitteropt) + (void)gps_query(gpsdata, "J=1"); + if (device) - (void)gps_query(gpsdata, "F=%s\n", device); + (void)gps_query(gpsdata, "F=%s", device); - (void)gps_query(gpsdata, "w+x\n"); + (void)gps_query(gpsdata, "w+x"); (void)XtAppAddInput(app, gpsdata->gps_fd, (XtPointer)XtInputReadMask, handle_input, NULL); |