From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Wiles, Keith" Subject: Re: next technical board meeting, 2017-04-06 Date: Fri, 31 Mar 2017 14:39:23 +0000 Message-ID: References: <20170330094058.nh2nhk4ko6tsqedn@localhost.localdomain> <20170330170512.14476bb0@platinum> <5C76150C-195D-4316-AC3B-6AE2441B254B@intel.com> <20170331105228.36617583@platinum> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Cc: Jerin Jacob , "dev@dpdk.org" , "techboard@dpdk.org" To: Olivier Matz Return-path: In-Reply-To: Content-Language: en-US Content-ID: <2E159C1412A132498FAB8D659145B2B5@intel.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Here is a few advantages to CLI: A couple big advantages I see are: - CLI supports commands, files, aliases, directories. - The alias command is just a string using a simple substitution suppor= t for other other commands similar to the bash shell like alias commands. - Files can be static or dynamic information, can be changed on the fly= and saved for later. The file is backed with a simple function callback to= allow the developer to update the content or not. - Added support for color and cursor movement APIs similar to Pktgen if n= eeded by the developer. - It is a work alike replacement for cmdline library. Both cmdline and CL= I can be used in the same application if care is taken. - Uses a simple fake like directory layout for command and files. Allowin= g for command hierarchy as path to the command can allow for specific targe= ts to be identified without having to state it on the command line.=20 - Has auto-complete for commands, similar to Unix/Linux autocomplete and = provides support for command option help as well. - Callback functions for commands are simply just argc/argv like function= s. The CLI does not convert arguments for the user, it is up to the develop= er to decode the argv[] values. - Most of the arguments converted in the current cmdline are difficult = to use or not required as the developer just picks string type and does the= conversion himself. - Dynamically be able to add and remove commands, directories, files and = aliases, does not need to be statically compiled into the application. - No weird structures in the code and reduces the line count for testpmd = from 11K to 4K lines. I convert testpmd to have both CMDLINE and CLI with a= command line option. - Two methods to parse command lines, first is the standard argc/argv met= hod in the function. The second method is to use a map of strings with simp= le printf like formatting to detect which command line the user typed. An I= D value it returned to the used to indicate which mapping string was found = to make the command line to be used in a switch statement. - Central help support if needed (optional). Regards, Keith