From 7283168ffd9d9d9d77053bca0609a2aef014e72b Mon Sep 17 00:00:00 2001
From: Cedric Roux <cedric.roux@eurecom.fr>
Date: Thu, 28 Apr 2016 14:54:51 +0200
Subject: [PATCH] -l option renamed -r, it's more "natural" plus there is a
 default now

---
 common/utils/T/tracer/local.c | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/common/utils/T/tracer/local.c b/common/utils/T/tracer/local.c
index c681b36aa6..bc205d40d5 100644
--- a/common/utils/T/tracer/local.c
+++ b/common/utils/T/tracer/local.c
@@ -9,6 +9,9 @@
 #include <fcntl.h>
 #include <pthread.h>
 
+#define DEFAULT_REMOTE_IP   "127.0.0.1"
+#define DEFAULT_REMOTE_PORT 2021
+
 #include "defs.h"
 
 #include "../T_defs.h"
@@ -94,7 +97,9 @@ void usage(void)
   printf(
 "tracer - local side\n"
 "options:\n"
-"    -l <IP address> <port>    local side (forwards packets to remote IP:port)\n"
+"    -r <IP address> <port>    forwards packets to remote IP:port\n"
+"                              (default %s:%d)\n",
+    DEFAULT_REMOTE_IP, DEFAULT_REMOTE_PORT
   );
   exit(1);
 }
@@ -103,8 +108,8 @@ int main(int n, char **v)
 {
   int s;
   int i;
-  char *remote_ip = NULL;
-  int remote_port = -1;
+  char *remote_ip = DEFAULT_REMOTE_IP;
+  int remote_port = DEFAULT_REMOTE_PORT;
   int port = 2020;
   void *f;
 
@@ -116,8 +121,6 @@ int main(int n, char **v)
     usage();
   }
 
-  if (remote_port == -1 || remote_ip == NULL) usage();
-
   f = forwarder(remote_ip, remote_port);
   init_shm();
   s = get_connection("127.0.0.1", port);
-- 
GitLab