summaryrefslogtreecommitdiff
path: root/gpsmon.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2013-10-02 16:45:53 -0400
committerEric S. Raymond <esr@thyrsus.com>2013-10-02 16:45:53 -0400
commitbe2f368054331d3ecf0d1006bf683eb40f224daf (patch)
tree3ab02d9144ed9625e4fbaa27307ae6a9d8bec0d9 /gpsmon.c
parent466a626ed1bda0680da82d21cbb31f637efa9a3e (diff)
downloadgpsd-be2f368054331d3ecf0d1006bf683eb40f224daf.tar.gz
When -t forces a driver type, show it in the gpsmon prompt.
Diffstat (limited to 'gpsmon.c')
-rw-r--r--gpsmon.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/gpsmon.c b/gpsmon.c
index 93134eed..7dbb2d06 100644
--- a/gpsmon.c
+++ b/gpsmon.c
@@ -513,6 +513,7 @@ int main(int argc, char **argv)
exit(EXIT_FAILURE);
}
break;
+ case 'T':
case 't':
fallback = NULL;
for (active = monitor_objects; *active; active++) {
@@ -523,11 +524,11 @@ int main(int argc, char **argv)
}
}
if (matches > 1) {
- (void)fprintf(stderr, "-T option matched more than one driver.\n");
+ (void)fprintf(stderr, "-t option matched more than one driver.\n");
exit(EXIT_FAILURE);
}
else if (matches == 0) {
- (void)fprintf(stderr, "-T option didn't match any driver.\n");
+ (void)fprintf(stderr, "-t option didn't match any driver.\n");
exit(EXIT_FAILURE);
}
active = NULL;
@@ -686,6 +687,11 @@ int main(int argc, char **argv)
/* refresh all windows */
(void)wprintw(cmdwin, type_name);
+ if (fallback != NULL) {
+ waddch(cmdwin, '(');
+ waddstr(cmdwin, (*fallback)->driver->type_name);
+ waddch(cmdwin, ')');
+ }
(void)wprintw(cmdwin, "> ");
(void)wclrtoeol(cmdwin);
if (active != NULL