[RFC PATCH 0/1] make cmdline library easier to use

Stephen Hemminger stephen at networkplumber.org
Wed Aug 2 20:05:07 CEST 2023


On Wed,  2 Aug 2023 18:00:51 +0100
Bruce Richardson <bruce.richardson at intel.com> wrote:

> And now for something completely different... :-)
> 
> While it's nice that DPDK includes a commandline library for easily
> adding interactivity to applications, the library itself is a little
> clunky to use, due to the massive amounts of boilerplate definitions
> required. Having used it recently on an app I was playing with for
> testing, I decided the situation can potentially be improved with it
> by use of a script to produce the boilerplate when given a simple
> list of commands the user wants to add to the app.
> 
> This is the result of that effort. Sending it here as a rough-draft to
> get feedback on whether this is worth including in DPDK itself.
> Hopefully others may find it of use.
> 
> Bruce Richardson (1):
>   cmdline/dpdk-cmdline-gen: generate boilerplate for simple cmds
> 
>  lib/cmdline/dpdk-cmdline-gen.py | 143 ++++++++++++++++++++++++++++++++
>  1 file changed, 143 insertions(+)
>  create mode 100755 lib/cmdline/dpdk-cmdline-gen.py

Ok, but this surely is a solved problem is some other open source library.
Or does every project reinvent this parsing?

Seems to me that something like bison/flex (ie yacc/lex) would be better
in terms of expressing the syntax separate from the implementation.


More information about the dev mailing list