From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from proxy.6wind.com (host.76.145.23.62.rev.coltfrance.com [62.23.145.76]) by dpdk.org (Postfix) with ESMTP id 5A8131B1DD for ; Tue, 19 Dec 2017 11:31:11 +0100 (CET) Received: from core.dev.6wind.com (unknown [10.0.0.1]) by proxy.6wind.com (Postfix) with ESMTPS id 450C3116933; Tue, 19 Dec 2017 11:22:32 +0100 (CET) Received: from [10.16.0.195] (helo=6wind.com) by core.dev.6wind.com with smtp (Exim 4.84_2) (envelope-from ) id 1eRFAp-0000TI-O3; Tue, 19 Dec 2017 11:31:00 +0100 Received: by 6wind.com (sSMTP sendmail emulation); Tue, 19 Dec 2017 11:30:59 +0100 Date: Tue, 19 Dec 2017 11:30:59 +0100 From: Olivier MATZ To: Xueming Li Cc: Jingjing Wu , dev@dpdk.org Message-ID: <20171219103058.dhozknvb6x3sxzk4@glumotte.dev.6wind.com> References: <20171115154545.8936-1-xuemingl@mellanox.com> <20171115154545.8936-2-xuemingl@mellanox.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171115154545.8936-2-xuemingl@mellanox.com> User-Agent: NeoMutt/20170113 (1.7.2) Subject: Re: [dpdk-dev] [PATCH 1/3] lib/cmdline: add echo support in batch loading from file X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Dec 2017 10:31:11 -0000 Hi Xueming, On Wed, Nov 15, 2017 at 11:45:43PM +0800, Xueming Li wrote: > Add echo option to echo commandline to screen when running loaded > scripts from file. > > Signed-off-by: Xueming Li > --- > lib/librte_cmdline/cmdline_socket.c | 5 +++-- > lib/librte_cmdline/cmdline_socket.h | 3 ++- > 2 files changed, 5 insertions(+), 3 deletions(-) > > diff --git a/lib/librte_cmdline/cmdline_socket.c b/lib/librte_cmdline/cmdline_socket.c > index 3fc243b70..e57ddeffb 100644 > --- a/lib/librte_cmdline/cmdline_socket.c > +++ b/lib/librte_cmdline/cmdline_socket.c > @@ -73,7 +73,8 @@ > #include "cmdline.h" > > struct cmdline * > -cmdline_file_new(cmdline_parse_ctx_t *ctx, const char *prompt, const char *path) > +cmdline_file_new(cmdline_parse_ctx_t *ctx, const char *prompt, const char *path, > + int echo) > { > int fd; > > @@ -86,7 +87,7 @@ cmdline_file_new(cmdline_parse_ctx_t *ctx, const char *prompt, const char *path) > dprintf("open() failed\n"); > return NULL; > } > - return cmdline_new(ctx, prompt, fd, -1); > + return cmdline_new(ctx, prompt, fd, echo ? 1 : -1); > } > > struct cmdline * > diff --git a/lib/librte_cmdline/cmdline_socket.h b/lib/librte_cmdline/cmdline_socket.h > index aa6068e7e..208134b12 100644 > --- a/lib/librte_cmdline/cmdline_socket.h > +++ b/lib/librte_cmdline/cmdline_socket.h > @@ -68,7 +68,8 @@ > extern "C" { > #endif > > -struct cmdline *cmdline_file_new(cmdline_parse_ctx_t *ctx, const char *prompt, const char *path); > +struct cmdline *cmdline_file_new(cmdline_parse_ctx_t *ctx, const char *prompt, > + const char *path, int echo); > struct cmdline *cmdline_stdin_new(cmdline_parse_ctx_t *ctx, const char *prompt); > void cmdline_stdin_exit(struct cmdline *cl); This breaks the API and ABI. And it also breaks the compilation, because the modifications of applications are done in the next commits. You can send a deprecation notice, and this patch could be added in for 18.05. But instead, I suggest you to reimplement your own version of cmdline_file_new() with the echo feature inside testpmd.