summaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorGary E. Miller <gem@rellim.com>2005-08-04 02:23:03 +0000
committerGary E. Miller <gem@rellim.com>2005-08-04 02:23:03 +0000
commit56286c8d4a91aa4dccd1bb8a6e5a969eb57680ba (patch)
tree4cd7853c98d1b1400952141dc9cb4e6a14ff14c0 /contrib
parent2032c033efe3bfc869bca44fb2a2c0ba26f03430 (diff)
downloadgpsd-56286c8d4a91aa4dccd1bb8a6e5a969eb57680ba.tar.gz
Add version number
Diffstat (limited to 'contrib')
-rw-r--r--contrib/gpspipe.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/contrib/gpspipe.c b/contrib/gpspipe.c
index f0988946..549be210 100644
--- a/contrib/gpspipe.c
+++ b/contrib/gpspipe.c
@@ -38,15 +38,20 @@
#include <stdlib.h>
#include "../gpsd.h"
+
+#define GPSPIPE_VER "0.1"
+
static void usage(const char *prog) {
fprintf(stderr, "%s: connect to local gpsd and dump data to stdout\n\n"
+ " Version %s\n\n"
"-h show this help\n"
"-r Dump raw NMEA\n"
- "-w Dump gpsd native data\n\n"
- "-t time stamp the data\n\n"
- "-n [count] exit after count packets\n\n"
+ "-w Dump gpsd native data\n"
+ "-t time stamp the data\n"
+ "-n [count] exit after count packets\n"
+ "-V print version and exit\n\n"
"You must specify one, or both, of -r/-w\n",
- prog);
+ prog, GPSPIPE_VER);
}
int main( int argc, char **argv) {
@@ -64,7 +69,7 @@ int main( int argc, char **argv) {
extern char *optarg;
- while ((option = getopt(argc, argv, "?hrwtn:")) != -1) {
+ while ((option = getopt(argc, argv, "?hrwtVn:")) != -1) {
switch (option) {
case 'n':
count = strtol(optarg, 0, 0);
@@ -78,6 +83,10 @@ int main( int argc, char **argv) {
case 'w':
dump_gpsd = 1;
break;
+ case 'V':
+ fprintf(stderr, "%s: Version %s\n", argv[0]
+ , GPSPIPE_VER);
+ exit(0);
case '?':
case 'h':
default: