From 6b2c145a2f88261a95f0dfad2ffa2a8b4e3fc898 Mon Sep 17 00:00:00 2001 From: hadaq Date: Sun, 8 Jan 2012 19:54:25 +0000 Subject: [PATCH] added new option: -e --- libtrbnet/trbcmd.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/libtrbnet/trbcmd.c b/libtrbnet/trbcmd.c index 2574030..75af570 100644 --- a/libtrbnet/trbcmd.c +++ b/libtrbnet/trbcmd.c @@ -25,7 +25,7 @@ static int hexMode = HEXMODE; -static const char trbcmd_version[] = "$Revision: 2.73 $"; +static const char trbcmd_version[] = "$Revision: 2.74 $"; #define BACKLOG 10 static uint16_t tcp_port = 55555; @@ -108,6 +108,7 @@ void usage(const char *progName) fprintf(stdout, " -H hex-mode: all arguments will be interpreted " "as hexadecimal-numbers\n"); + fprintf(stdout, " -e put a EOF marker \"\" at end of output\n"); fprintf(stdout, " -V version number\n"); fprintf(stdout, "\nCommands:\n"); fprintf(stdout, " r -> " @@ -191,15 +192,16 @@ int start(int argc, char **argv) int loop = 1; int sleepTime = 0; int loopCtr = 0; + int eof_marker = 0; uint16_t trgCtr = 0; /* counter for the %ctr option */ int opt; int i; #ifdef PEXOR - const char optString[] = "+hf:n:d:s:HMVD"; + const char optString[] = "+hf:n:d:s:HMVeD"; pexor_dma = 1; #else - const char optString[] = "+hf:n:d:s:HMV"; + const char optString[] = "+hf:n:d:s:HMVe"; #endif trb_debug = 0; @@ -231,6 +233,9 @@ int start(int argc, char **argv) case 'H': hexMode = 1; break; + case 'e': + eof_marker = 1; + break; case 'V': printf("%s %s, using libtrbnet %s\n", basename(argv[0]), trbcmd_version, trbnet_version); @@ -1263,8 +1268,11 @@ int start(int argc, char **argv) logError(ERROR, "Invalid command, try -h option\n"); return -1; } + if (eof_marker == 1) { + fprintf(stdout, "\n"); + } } /* End script-file-loop */ - + trgCtr++; if (sleepTime > 0) { -- 2.43.0