diff --git a/src/ca/client/tools/caget.c b/src/ca/client/tools/caget.c index 00056709e..75225d07f 100644 --- a/src/ca/client/tools/caget.c +++ b/src/ca/client/tools/caget.c @@ -34,6 +34,7 @@ #include #include #include +#include "epicsVersion.h" #include "tool_lib.h" @@ -55,6 +56,7 @@ static void usage (void) { fprintf (stderr, "\nUsage: caget [options] ...\n\n" " -h: Help: Print this message\n" + " -V: Version: Show EPICS and CA versions\n" "Channel Access options:\n" " -w : Wait time, specifies CA timeout, default is %f second(s)\n" " -c: Asynchronous get (use ca_get_callback and wait for completion)\n" @@ -389,11 +391,14 @@ int main (int argc, char *argv[]) LINE_BUFFER(stdout); /* Configure stdout buffering */ - while ((opt = getopt(argc, argv, ":taicnhsSe:f:g:l:#:d:0:w:p:F:")) != -1) { + while ((opt = getopt(argc, argv, ":taicnhsSVe:f:g:l:#:d:0:w:p:F:")) != -1) { switch (opt) { case 'h': /* Print usage */ usage(); return 0; + case 'V': + printf( "\nEPICS Version %s, CA Protocol version %s\n", EPICS_VERSION_STRING, ca_version() ); + return 0; case 't': /* Terse output mode */ complainIfNotPlainAndSet(&format, terse); break; diff --git a/src/ca/client/tools/cainfo.c b/src/ca/client/tools/cainfo.c index ad580f473..fc18ccd3f 100644 --- a/src/ca/client/tools/cainfo.c +++ b/src/ca/client/tools/cainfo.c @@ -23,6 +23,7 @@ #include #include +#include "epicsVersion.h" #include #include @@ -36,12 +37,14 @@ void usage (void) { fprintf (stderr, "\nUsage: cainfo [options] ...\n\n" " -h: Help: Print this message\n" + " -V: Version: Show EPICS and CA versions\n" "Channel Access options:\n" " -w : Wait time, specifies CA timeout, default is %f second(s)\n" " -s : Call ca_client_status with the specified interest level\n" " -p : CA priority (0-%u, default 0=lowest)\n" "\nExample: cainfo my_channel another_channel\n\n" , DEFAULT_TIMEOUT, CA_PRIORITY_MAX); + fprintf (stderr, "\nEPICS Version %s, CA Protocol version %s\n", EPICS_VERSION_STRING, ca_version() ); } @@ -137,11 +140,14 @@ int main (int argc, char *argv[]) LINE_BUFFER(stdout); /* Configure stdout buffering */ - while ((opt = getopt(argc, argv, ":nhw:s:p:")) != -1) { + while ((opt = getopt(argc, argv, ":nhVw:s:p:")) != -1) { switch (opt) { case 'h': /* Print usage */ usage(); return 0; + case 'V': + printf( "\nEPICS Version %s, CA Protocol version %s\n", EPICS_VERSION_STRING, ca_version() ); + return 0; case 'w': /* Set CA timeout value */ if(epicsScanDouble(optarg, &caTimeout) != 1) { diff --git a/src/ca/client/tools/camonitor.c b/src/ca/client/tools/camonitor.c index 307dad8d6..a3fdecd55 100644 --- a/src/ca/client/tools/camonitor.c +++ b/src/ca/client/tools/camonitor.c @@ -26,6 +26,7 @@ #include #include #include +#include "epicsVersion.h" #include #include @@ -44,7 +45,8 @@ void usage (void) { fprintf (stderr, "\nUsage: camonitor [options] ...\n" "\n" - " -h: Help; Print this message\n" + " -h: Help: Print this message\n" + " -V: Version: Show EPICS and CA versions\n" "Channel Access options:\n" " -w : Wait time, specifies CA timeout, default is %f second(s)\n" " -m : Specify CA event mask to use. is any combination of\n" @@ -209,11 +211,14 @@ int main (int argc, char *argv[]) LINE_BUFFER(stdout); /* Configure stdout buffering */ - while ((opt = getopt(argc, argv, ":nhm:sSe:f:g:l:#:0:w:t:p:F:")) != -1) { + while ((opt = getopt(argc, argv, ":nhVm:sSe:f:g:l:#:0:w:t:p:F:")) != -1) { switch (opt) { case 'h': /* Print usage */ usage(); return 0; + case 'V': + printf( "\nEPICS Version %s, CA Protocol version %s\n", EPICS_VERSION_STRING, ca_version() ); + return 0; case 'n': /* Print ENUM as index numbers */ enumAsNr=1; break; diff --git a/src/ca/client/tools/caput.c b/src/ca/client/tools/caput.c index 5e4d10e23..79ffef8c3 100644 --- a/src/ca/client/tools/caput.c +++ b/src/ca/client/tools/caput.c @@ -37,6 +37,7 @@ #include #include #include +#include "epicsVersion.h" #include "tool_lib.h" @@ -59,6 +60,7 @@ void usage (void) fprintf (stderr, "\nUsage: caput [options] ...\n" " caput -a [options] ...\n\n" " -h: Help: Print this message\n" + " -V: Version: Show EPICS and CA versions\n" "Channel Access options:\n" " -w : Wait time, specifies CA timeout, default is %f second(s)\n" " -c: Asynchronous put (use ca_put_callback and wait for completion)\n" @@ -281,11 +283,14 @@ int main (int argc, char *argv[]) LINE_BUFFER(stdout); /* Configure stdout buffering */ putenv("POSIXLY_CORRECT="); /* Behave correct on GNU getopt systems */ - while ((opt = getopt(argc, argv, ":cnlhatsS#:w:p:F:")) != -1) { + while ((opt = getopt(argc, argv, ":cnlhatsVS#:w:p:F:")) != -1) { switch (opt) { case 'h': /* Print usage */ usage(); return 0; + case 'V': + printf( "\nEPICS Version %s, CA Protocol version %s\n", EPICS_VERSION_STRING, ca_version() ); + return 0; case 'n': /* Force interpret ENUM as index number */ enumAsNr = 1; enumAsString = 0;