From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 066CD42FB9; Wed, 2 Aug 2023 20:05:12 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9293340DDB; Wed, 2 Aug 2023 20:05:11 +0200 (CEST) Received: from mail-pg1-f182.google.com (mail-pg1-f182.google.com [209.85.215.182]) by mails.dpdk.org (Postfix) with ESMTP id 8F3B54021D for ; Wed, 2 Aug 2023 20:05:10 +0200 (CEST) Received: by mail-pg1-f182.google.com with SMTP id 41be03b00d2f7-563f8e8a53dso7307a12.3 for ; Wed, 02 Aug 2023 11:05:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20221208.gappssmtp.com; s=20221208; t=1690999509; x=1691604309; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=OCRimoH58igoZMl9L/fJS2yfRefc8l1hCcn4d+zZlxM=; b=v6v6N0shg3vLiObaMakXyCqSLaVFN8vxYLvUKbZEhgX+9F/xsVe9t3Li3p73WQdJ1E 5Hg66it3rD+Bg2wlt2mTMIDKFO/QBxhNxh20KM97lo0yU2hz0JzQT2Tluy08hA7i/Jyk oKSs1Kw31u/SZHmg64KyfnL2RWp+Sl5KfcemNBbwArl9nxzqRxMaReidGG26nvsjkmsP G5VIOlpLtVdhNzS4X07sfKxPjqi7i8sn/1l9Sqom5gxEZ9ZCrvBA7eQtHBFD+bRLL6kO DLn6d7UZ2lJPcSHb2aKbRLImp9PKt1FGFRBYgy+fL36pgmH1aIDs4pqFTBMU6zrCAh3C 9gmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690999509; x=1691604309; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=OCRimoH58igoZMl9L/fJS2yfRefc8l1hCcn4d+zZlxM=; b=cF3koWtpXPYCsN1VPjAQgnJDnYDJ1/R5q5DXjTc5dK6UV5KBpOO1wrtFJ1mrBRCX6J iV4zUFj0GuF2nHPLRIMt5JPxYFjTRNqBfXvcXnjviL6GE53qkYm+9brF1ZDovobSplzd jc3/2cNjjX3MZtzGoR61dRCo+VdeQgBgf7ggDbm/Xg8GKITjBGlMpfu9dtgoG0Ume0d+ i0EoyYxSRPbb/40+EQjZVATi9ID7OlcpaW93wWuC74SMchphQeesmDuaYkEk3fnVWCYY dK9oNf9ULa9TMlXIDG2Hrm4/tqqRdwM4Stf6zVSsy3Z9ttq/6jFc2zN/DxjSn4pVJ2e5 warw== X-Gm-Message-State: ABy/qLaQBCFX4QGDlEqL2zjYHdyRy/vr/UwkYPD6tPd+kBs1O6abmUxM izlgGbrbxbLhvQVTAuakyjNZcg== X-Google-Smtp-Source: APBJJlERVyv5WR3qBLUtVyTAkK5z3tksvbp56gplMDiBS3PzTzu7CO6Y+P2JgX3JwCwR3dWC0Od6EA== X-Received: by 2002:a17:90a:d186:b0:268:1ddd:266a with SMTP id fu6-20020a17090ad18600b002681ddd266amr14018610pjb.30.1690999509516; Wed, 02 Aug 2023 11:05:09 -0700 (PDT) Received: from hermes.local (204-195-127-207.wavecable.com. [204.195.127.207]) by smtp.gmail.com with ESMTPSA id gz24-20020a17090b0ed800b002677739860fsm1369613pjb.34.2023.08.02.11.05.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Aug 2023 11:05:09 -0700 (PDT) Date: Wed, 2 Aug 2023 11:05:07 -0700 From: Stephen Hemminger To: Bruce Richardson Cc: dev@dpdk.org, Olivier Matz Subject: Re: [RFC PATCH 0/1] make cmdline library easier to use Message-ID: <20230802110507.483a6b4d@hermes.local> In-Reply-To: <20230802170052.955323-1-bruce.richardson@intel.com> References: <20230802170052.955323-1-bruce.richardson@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On Wed, 2 Aug 2023 18:00:51 +0100 Bruce Richardson 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.